init
这个提交包含在:
父节点
e10e5019b7
当前提交
be057b8325
@ -47,10 +47,6 @@ android {
|
||||
}
|
||||
signingConfigs {
|
||||
debug {
|
||||
keyAlias 'xuqm'
|
||||
keyPassword 'xuqinmin1022'
|
||||
storeFile file('key')
|
||||
storePassword 'xuqinmin1022'
|
||||
}
|
||||
releaseConfig {}
|
||||
}
|
||||
@ -63,7 +59,7 @@ android {
|
||||
androidExtensions {
|
||||
experimental = true
|
||||
}
|
||||
namespace 'com.bjca.hp.acupuncture'
|
||||
namespace 'com.nova.brain.glass'
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
@ -3,16 +3,6 @@
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- 网络权限 -->
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" /> <!-- <uses-permission android:name="android.permission.READ_LOGS" /> -->
|
||||
<uses-feature android:name="android.hardware.camera" />
|
||||
<uses-feature android:name="android.hardware.camera.autofocus" />
|
||||
|
||||
<application
|
||||
android:name=".MyApplication"
|
||||
@ -23,23 +13,7 @@
|
||||
android:theme="@style/AppTheme"
|
||||
android:usesCleartextTraffic="true"
|
||||
tools:replace="android:label">
|
||||
<activity
|
||||
android:name=".ui.TestActivity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".ui.SettingActivity"
|
||||
android:exported="false" />
|
||||
|
||||
<receiver
|
||||
android:name=".receiver.BootCompleteReceiver"
|
||||
android:enabled="true"
|
||||
android:exported="true">
|
||||
|
||||
<!-- 接收启动完成的广播 -->
|
||||
<intent-filter android:priority="1000">
|
||||
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<activity
|
||||
android:name=".ui.MainActivity"
|
||||
|
||||
二进制文件未显示。
二进制文件未显示。
二进制文件未显示。
二进制文件未显示。
二进制文件未显示。
二进制文件未显示。
@ -1,10 +1,10 @@
|
||||
package com.bjca.hp.acupuncture;
|
||||
package com.nova.brain.glass;
|
||||
|
||||
import com.xuqm.base.App;
|
||||
import com.xuqm.base.di.component.AppComponent;
|
||||
import com.xuqm.base.di.manager.HttpManager;
|
||||
import com.bjca.hp.acupuncture.common.CrashHandler;
|
||||
import com.bjca.hp.acupuncture.repository.HeaderInterceptor;
|
||||
import com.nova.brain.glass.common.CrashHandler;
|
||||
import com.nova.brain.glass.repository.HeaderInterceptor;
|
||||
|
||||
/**
|
||||
* @author xuqm
|
||||
@ -12,15 +12,11 @@ import com.bjca.hp.acupuncture.repository.HeaderInterceptor;
|
||||
public class MyApplication extends App {
|
||||
|
||||
public static String baseUrl = "http://10.10.203.120:31734";
|
||||
public static AppComponent appComponent1;
|
||||
public static AppComponent appComponent2;
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
appComponent = HttpManager.getAppComponent(baseUrl, new HeaderInterceptor(getApplicationContext()));
|
||||
appComponent1 = HttpManager.getAppComponent("http://10.10.203.120:35662", new HeaderInterceptor(getApplicationContext()));
|
||||
appComponent2 = HttpManager.getAppComponent("http://10.10.203.120:31669", new HeaderInterceptor(getApplicationContext()));
|
||||
|
||||
CrashHandler.getInstance().init(this);
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package com.bjca.hp.acupuncture.common;
|
||||
package com.nova.brain.glass.common;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Environment;
|
||||
@ -20,7 +20,6 @@ import java.util.Locale;
|
||||
/*************************************************************************************************
|
||||
* <pre>
|
||||
* @包路径: cn.org.bjca.wcert.ywq.utils.crash
|
||||
* @版权所有: 北京数字认证股份有限公司 (C) 2017
|
||||
*
|
||||
* @类描述:
|
||||
* @版本: V1.5.1
|
||||
|
||||
@ -1,248 +0,0 @@
|
||||
package com.bjca.hp.acupuncture.common;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.rabbitmq.client.AMQP;
|
||||
import com.rabbitmq.client.AlreadyClosedException;
|
||||
import com.rabbitmq.client.Channel;
|
||||
import com.rabbitmq.client.Connection;
|
||||
import com.rabbitmq.client.ConnectionFactory;
|
||||
import com.rabbitmq.client.DefaultConsumer;
|
||||
import com.rabbitmq.client.Envelope;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
|
||||
/***************************************************************************
|
||||
* <pre></pre>
|
||||
* @文件名称: RabbitMQClient
|
||||
* @包 路 径: com.bjca.hp.acupuncture.common
|
||||
* @版权所有:北京数字医信责任有限公司 (C) 2022
|
||||
*
|
||||
* @类描述:
|
||||
* @版本: V1.0
|
||||
* @创建人: xuqm
|
||||
* @创建时间:2022/6/15 下午 02:19
|
||||
* @修改记录:
|
||||
*/
|
||||
public class RabbitMQClient {
|
||||
private final String TAG = "RabbitMQ";
|
||||
private final String FLAG_SEND = "send";
|
||||
private final String FLAG_RECEIVE = "receive";
|
||||
|
||||
private final ConnectionFactory factory;
|
||||
private Connection connection;
|
||||
private Map<String, Channel> channelMap = new HashMap<>();
|
||||
|
||||
public static final String EXCHANGETYPE_FANOUT = "fanout"; //不用匹配路由,发送给所有绑定转换器的队列
|
||||
public static final String EXCHANGETYPE_DIRECT = "direct"; //匹配路由一致,才发送给绑定转换器队列
|
||||
public static final String EXCHANGETYPE_TOPIC = "topic"; // 通配符* 和 # 匹配路由一致,才发送给绑定转换器队列
|
||||
|
||||
|
||||
public RabbitMQClient(String hostIp, int port, String username, String password) {
|
||||
factory = new ConnectionFactory();
|
||||
factory.setUsername(username);
|
||||
factory.setPassword(password);
|
||||
factory.setHost(hostIp);
|
||||
factory.setPort(port);
|
||||
factory.setVirtualHost("/");//类似数据库的意思
|
||||
factory.setConnectionTimeout(15 * 1000); //连接时间设置为10秒
|
||||
factory.setAutomaticRecoveryEnabled(true); //恢复连接,通道
|
||||
factory.setTopologyRecoveryEnabled(true); //恢复通道中 转换器,队列,绑定关系等
|
||||
factory.setNetworkRecoveryInterval(5 * 1000); //恢复连接间隔,默认5秒
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param message 需要发送的消息
|
||||
* @param queueName 管道名称
|
||||
* @date 创建时间:2020/9/8 0008
|
||||
* @auther gaoxiaoxiong
|
||||
* @Descriptiion
|
||||
**/
|
||||
public void sendQueueMessage(String message, String queueName) throws IOException, TimeoutException, AlreadyClosedException {
|
||||
if (connection == null || !connection.isOpen()) {
|
||||
connection = factory.newConnection();
|
||||
}
|
||||
if (!channelMap.containsKey(FLAG_SEND + queueName)) {
|
||||
Channel channel = connection.createChannel();
|
||||
channel.queueDeclare(queueName, false, false, false, null);
|
||||
channelMap.put(FLAG_SEND + queueName, channel);
|
||||
}
|
||||
//空名字的交换机,需要设置routingKey,此时会将routingKey 作为 队列名使用
|
||||
channelMap.get(FLAG_SEND + queueName).basicPublish("", queueName, null, message.getBytes());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param exchangeName 交换机名称
|
||||
* @param message 需要发送的消息
|
||||
* @param queueName 队列名称
|
||||
* @param routingKey 路由规则
|
||||
* @date 创建时间:2020/9/8 0008
|
||||
* @auther gaoxiaoxiong
|
||||
* @Descriptiion 发送 exchangeType direct 类型的信息
|
||||
**/
|
||||
public void sendDirectTypeMessage(String exchangeName, String message, String queueName, String routingKey) throws IOException, TimeoutException, AlreadyClosedException {
|
||||
if (connection == null || !connection.isOpen()) {
|
||||
connection = factory.newConnection();
|
||||
}
|
||||
if (!channelMap.containsKey(FLAG_SEND + exchangeName + EXCHANGETYPE_DIRECT + queueName)) {
|
||||
Channel channel = connection.createChannel();
|
||||
channel.queueDeclare(queueName, false, false, false, null);
|
||||
channel.exchangeDeclare(exchangeName, EXCHANGETYPE_DIRECT);
|
||||
channelMap.put(FLAG_SEND + exchangeName + EXCHANGETYPE_DIRECT + queueName, channel);
|
||||
}
|
||||
channelMap.get(FLAG_SEND + exchangeName + EXCHANGETYPE_DIRECT + queueName).basicPublish(exchangeName, routingKey, null, message.getBytes());
|
||||
}
|
||||
|
||||
/**
|
||||
* @param exchangeName 交换机名称
|
||||
* @param queueName 队列名称
|
||||
* @param message 发送的消息
|
||||
* @date 创建时间:2020/9/8 0008
|
||||
* @auther gaoxiaoxiong
|
||||
* @Descriptiion 发送 exchangeType fanout 类型的信息
|
||||
**/
|
||||
public void sendFanoutTypeMessage(String exchangeName, String queueName, String message) throws IOException, TimeoutException, AlreadyClosedException {
|
||||
if (connection == null || !connection.isOpen()) {
|
||||
connection = factory.newConnection();
|
||||
}
|
||||
if (!channelMap.containsKey(FLAG_SEND + exchangeName + EXCHANGETYPE_FANOUT + queueName)) {
|
||||
Channel channel = connection.createChannel();
|
||||
channel.queueDeclare(queueName, false, false, false, null);
|
||||
channel.exchangeDeclare(exchangeName, EXCHANGETYPE_FANOUT);
|
||||
channelMap.put(FLAG_SEND + exchangeName + EXCHANGETYPE_FANOUT + queueName, channel);
|
||||
}
|
||||
channelMap.get(FLAG_SEND + exchangeName + EXCHANGETYPE_FANOUT + queueName).basicPublish(exchangeName, "", null, message.getBytes());
|
||||
}
|
||||
|
||||
/**
|
||||
* @param exchangeName 交换机名称
|
||||
* @param exchangeType 模式
|
||||
* @param queueName 队列名称
|
||||
* @param message 需要发送的消息
|
||||
* @param routingKey 路由规则
|
||||
* @date 创建时间:2020/9/8 0008
|
||||
* @auther gaoxiaoxiong
|
||||
* @Descriptiion
|
||||
**/
|
||||
public void sendExchangeNameQueueMessage(String exchangeName, String exchangeType, String message, String queueName, String routingKey) throws IOException, TimeoutException, AlreadyClosedException {
|
||||
if (connection == null || !connection.isOpen()) {
|
||||
connection = factory.newConnection();
|
||||
}
|
||||
if (!channelMap.containsKey(FLAG_SEND + exchangeName + exchangeType + queueName)) {
|
||||
Channel channel = connection.createChannel();
|
||||
channel.queueDeclare(queueName, false, false, false, null);
|
||||
channel.exchangeDeclare(exchangeName, exchangeType);
|
||||
channelMap.put(FLAG_SEND + exchangeName + exchangeType + queueName, channel);
|
||||
}
|
||||
if (exchangeType.equals(EXCHANGETYPE_FANOUT)) {
|
||||
channelMap.get(FLAG_SEND + exchangeName + exchangeType + queueName).basicPublish(exchangeName, "", null, message.getBytes());
|
||||
} else if (exchangeType.equals(EXCHANGETYPE_DIRECT)) {
|
||||
channelMap.get(FLAG_SEND + exchangeName + exchangeType + queueName).basicPublish(exchangeName, routingKey, null, message.getBytes());
|
||||
} else if (exchangeType.equals(EXCHANGETYPE_TOPIC)) {
|
||||
channelMap.get(FLAG_SEND + exchangeName + exchangeType + queueName).basicPublish(exchangeName, routingKey, null, message.getBytes());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param queueName 队列名称
|
||||
* @date 创建时间:2020/9/8 0008
|
||||
* @auther gaoxiaoxiong
|
||||
* @Descriptiion
|
||||
**/
|
||||
public void receiveQueueMessage(final String queueName, final ResponseListener listener)
|
||||
throws IOException, TimeoutException, AlreadyClosedException {
|
||||
receiveQueueRoutingKeyMessage(queueName, "", "", "", listener);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param queueName 队列名称
|
||||
* @param routingKey 路由规则
|
||||
* @param exchangeName 交换机名称
|
||||
* @param exchangeType 交换机类型
|
||||
* @date 创建时间:2020/9/8 0008
|
||||
* @auther gaoxiaoxiong
|
||||
* @Descriptiion
|
||||
**/
|
||||
public void receiveQueueRoutingKeyMessage(String queueName, final String routingKey, String exchangeName, String exchangeType, final ResponseListener listener)
|
||||
throws IOException, TimeoutException, AlreadyClosedException {
|
||||
|
||||
if (exchangeType.equals(EXCHANGETYPE_DIRECT) || exchangeType.equals(EXCHANGETYPE_TOPIC)) {
|
||||
if (TextUtils.isEmpty(routingKey)) {
|
||||
throw new NullPointerException("路由规则不能为空");
|
||||
}
|
||||
}
|
||||
|
||||
if (!TextUtils.isEmpty(routingKey)) {
|
||||
if (TextUtils.isEmpty(exchangeName)) {
|
||||
throw new NullPointerException("交换机名称不能为空");
|
||||
}
|
||||
}
|
||||
|
||||
if (!channelMap.containsKey(FLAG_RECEIVE + routingKey + queueName)) {
|
||||
if (connection == null || !connection.isOpen()) {
|
||||
connection = factory.newConnection();
|
||||
}
|
||||
|
||||
final Channel channel = connection.createChannel();
|
||||
channel.queueDeclare(queueName, true, false, false, null);
|
||||
//绑定转换器,使用路由筛选消息
|
||||
if (!TextUtils.isEmpty(routingKey)) {
|
||||
channel.exchangeDeclare(exchangeName, exchangeType);
|
||||
channel.queueBind(queueName, exchangeName, routingKey); //设置绑定
|
||||
}
|
||||
//监听队列
|
||||
channel.basicConsume(queueName, false, new DefaultConsumer(channel) {
|
||||
@Override
|
||||
public void handleDelivery(String consumerTag, Envelope envelope,
|
||||
AMQP.BasicProperties properties, byte[] body)
|
||||
throws IOException {
|
||||
String message = new String(body, "UTF-8");
|
||||
if (listener != null) {
|
||||
listener.receive(message);
|
||||
}
|
||||
channel.basicAck(envelope.getDeliveryTag(), false); //消息应答
|
||||
}
|
||||
});
|
||||
channelMap.put(FLAG_RECEIVE + routingKey + queueName, channel);
|
||||
Log.e(TAG,"已经连接上了,队列名称:" + queueName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 关闭所有资源
|
||||
*/
|
||||
public void close() {
|
||||
for (Channel next : channelMap.values()) {
|
||||
if (next != null && next.isOpen()) {
|
||||
try {
|
||||
next.close();
|
||||
} catch (IOException | TimeoutException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
channelMap.clear();
|
||||
if (connection != null && connection.isOpen()) {
|
||||
try {
|
||||
connection.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public interface ResponseListener {
|
||||
void receive(String message);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,239 +0,0 @@
|
||||
package com.bjca.hp.acupuncture.common;
|
||||
|
||||
import android.os.SystemClock;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.rabbitmq.client.AlreadyClosedException;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
|
||||
/***************************************************************************
|
||||
* <pre></pre>
|
||||
* @文件名称: RabbitMQUtil
|
||||
* @包 路 径: com.bjca.hp.acupuncture.common
|
||||
* @版权所有:北京数字医信责任有限公司 (C) 2022
|
||||
*
|
||||
* @类描述:
|
||||
* @版本: V1.0
|
||||
* @创建人: xuqm
|
||||
* @创建时间:2022/6/15 下午 02:22
|
||||
* @修改记录:
|
||||
*/
|
||||
public class RabbitMQUtil {
|
||||
private boolean isRunning = true;
|
||||
private RabbitMQClient rabbitMQ;
|
||||
private ExecutorService executor;
|
||||
|
||||
|
||||
public RabbitMQUtil(String hostIp, int port, String username, String password) {
|
||||
rabbitMQ = new RabbitMQClient(hostIp, port, username, password);
|
||||
executor = Executors.newSingleThreadExecutor(); //根据项目需要设置常用线程个数
|
||||
}
|
||||
|
||||
/**
|
||||
* @param message 发送的消息
|
||||
* @param queueName 队列名称
|
||||
* @date 创建时间:2020/9/8 0008
|
||||
* @auther gaoxiaoxiong
|
||||
* @Descriptiion
|
||||
**/
|
||||
public void sendMessage(final String message, final String queueName, final SendMessageListener sendMessageListener,final ErrorMessageListener errorMessageListener) {
|
||||
executor.execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
rabbitMQ.sendQueueMessage(message, queueName);
|
||||
if (sendMessageListener != null) sendMessageListener.sendMessage(true);
|
||||
} catch (IOException | TimeoutException | AlreadyClosedException e) {
|
||||
e.printStackTrace();
|
||||
if (errorMessageListener!=null){
|
||||
errorMessageListener.errorMessage(e);
|
||||
}
|
||||
if (sendMessageListener != null) sendMessageListener.sendMessage(false);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @param message 发送的消息
|
||||
* @param exchangeName 交换机名称
|
||||
* @param queueName 队列名称
|
||||
* @date 创建时间:2020/9/8 0008
|
||||
* @auther gaoxiaoxiong
|
||||
* @Descriptiion
|
||||
**/
|
||||
public void sendMessage(final String message, final String exchangeName, final String exchangeType, final String queueName, final String routingKey, final SendMessageListener sendMessageListener,final ErrorMessageListener errorMessageListener) {
|
||||
executor.execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
rabbitMQ.sendExchangeNameQueueMessage(exchangeName, exchangeType, message, queueName, routingKey);
|
||||
if (sendMessageListener != null) sendMessageListener.sendMessage(true);
|
||||
} catch (IOException | TimeoutException | AlreadyClosedException e) {
|
||||
e.printStackTrace();
|
||||
if (errorMessageListener!=null){
|
||||
errorMessageListener.errorMessage(e);
|
||||
}
|
||||
if (sendMessageListener != null) sendMessageListener.sendMessage(false);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @param exchangeName 交换机名称
|
||||
* @param queueName 队列名称
|
||||
* @param message 需要发送的消息
|
||||
* @date 创建时间:2020/9/8 0008
|
||||
* @auther gaoxiaoxiong
|
||||
* @Descriptiion
|
||||
**/
|
||||
public void sendFanoutTypeMessage(final String exchangeName, final String message, final String queueName, final SendMessageListener sendMessageListener,final ErrorMessageListener errorMessageListener) {
|
||||
executor.execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
rabbitMQ.sendFanoutTypeMessage(exchangeName, queueName, message);
|
||||
if (sendMessageListener != null) sendMessageListener.sendMessage(true);
|
||||
} catch (IOException | TimeoutException | AlreadyClosedException e) {
|
||||
e.printStackTrace();
|
||||
if (errorMessageListener!=null){
|
||||
errorMessageListener.errorMessage(e);
|
||||
}
|
||||
if (sendMessageListener != null) sendMessageListener.sendMessage(false);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @param exchangeName 交换机名称
|
||||
* @param message 需要发送的消息
|
||||
* @param queueName 队列名称
|
||||
* @param routingKey 路由规则
|
||||
* @date 创建时间:2020/9/8 0008
|
||||
* @auther gaoxiaoxiong
|
||||
* @Descriptiion 发送 exchangeType direct 类型的信息
|
||||
**/
|
||||
public void sendDirectTypeMessage(final String exchangeName, final String queueName, final String message, final String routingKey, final SendMessageListener sendMessageListener,final ErrorMessageListener errorMessageListener) {
|
||||
executor.execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
rabbitMQ.sendDirectTypeMessage(exchangeName, queueName, message, routingKey);
|
||||
if (sendMessageListener != null) sendMessageListener.sendMessage(true);
|
||||
} catch (IOException | TimeoutException | AlreadyClosedException e) {
|
||||
e.printStackTrace();
|
||||
if (errorMessageListener!=null){
|
||||
errorMessageListener.errorMessage(e);
|
||||
}
|
||||
if (sendMessageListener != null) sendMessageListener.sendMessage(false);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @param queueName 队列名称
|
||||
* @date 创建时间:2020/9/8 0008
|
||||
* @auther gaoxiaoxiong
|
||||
* @Descriptiion
|
||||
**/
|
||||
public void receiveQueueMessage(String queueName, final ReceiveMessageListener listener,final ErrorMessageListener errorMessageListener) {
|
||||
String newQueueName = null;
|
||||
if (TextUtils.isEmpty(queueName)){
|
||||
newQueueName = createDefaultQueueName(queueName);
|
||||
}else {
|
||||
newQueueName = queueName;
|
||||
}
|
||||
final String finalNewQueueName = newQueueName;
|
||||
executor.execute(() -> {
|
||||
while (isRunning) {
|
||||
try {
|
||||
rabbitMQ.receiveQueueMessage(finalNewQueueName, message -> {
|
||||
if (listener != null) listener.receiveMessage(message);
|
||||
});
|
||||
} catch (IOException | TimeoutException | AlreadyClosedException e) {
|
||||
if (errorMessageListener!=null){
|
||||
errorMessageListener.errorMessage(e);
|
||||
}
|
||||
e.printStackTrace();
|
||||
SystemClock.sleep(5000);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void receiveQueueRoutingKeyMessage(String queueName, final String routingKey, final String exchangeName, final String exchangeType, final ReceiveMessageListener listener,final ErrorMessageListener errorMessageListener) {
|
||||
String newQueueName = null;
|
||||
if (TextUtils.isEmpty(queueName)){
|
||||
newQueueName = createDefaultQueueName(queueName);
|
||||
}else {
|
||||
newQueueName = queueName;
|
||||
}
|
||||
final String finalNewQueueName = newQueueName;
|
||||
executor.execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
while (isRunning) {
|
||||
try {
|
||||
rabbitMQ.receiveQueueRoutingKeyMessage(finalNewQueueName, routingKey, exchangeName, exchangeType, new RabbitMQClient.ResponseListener() {
|
||||
@Override
|
||||
public void receive(String message) {
|
||||
if (listener != null) listener.receiveMessage(message);
|
||||
}
|
||||
|
||||
});
|
||||
} catch (IOException | TimeoutException | AlreadyClosedException e) {
|
||||
if (errorMessageListener!=null){
|
||||
errorMessageListener.errorMessage(e);
|
||||
}
|
||||
e.printStackTrace();
|
||||
SystemClock.sleep(5000); //等待五秒
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public String createDefaultQueueName(String routingKey) {
|
||||
if (TextUtils.isEmpty(routingKey)){
|
||||
routingKey = "";
|
||||
}
|
||||
return routingKey + "@" + UUID.randomUUID();
|
||||
}
|
||||
|
||||
/**
|
||||
* 建议:
|
||||
* 在application中关闭或者在结束工作时关闭
|
||||
*/
|
||||
public void close() {
|
||||
isRunning = false;
|
||||
executor.execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
rabbitMQ.close();
|
||||
executor.shutdownNow();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public interface ReceiveMessageListener {
|
||||
void receiveMessage(String message);
|
||||
}
|
||||
|
||||
public interface SendMessageListener {
|
||||
void sendMessage(boolean isSuccess);
|
||||
}
|
||||
|
||||
public interface ErrorMessageListener{
|
||||
void errorMessage(Exception e);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package com.bjca.hp.acupuncture.common
|
||||
package com.nova.brain.glass.common
|
||||
|
||||
const val SHARE_RISK_LOCATION = "share_risk_location"
|
||||
const val SHARE_RISK_PURE = "share_risk_pure"
|
||||
|
||||
@ -1,72 +0,0 @@
|
||||
package com.bjca.hp.acupuncture.model
|
||||
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
data class DrugUsage(
|
||||
|
||||
@field:SerializedName("total")
|
||||
val total: Int,
|
||||
|
||||
@field:SerializedName("size")
|
||||
val size: Int,
|
||||
|
||||
@field:SerializedName("nulls")
|
||||
val nulls: Any,
|
||||
|
||||
@field:SerializedName("index")
|
||||
val index: Int,
|
||||
|
||||
@field:SerializedName("items")
|
||||
val items: List<ItemsItem5>
|
||||
)
|
||||
|
||||
data class ItemsItem5(
|
||||
|
||||
@field:SerializedName("code")
|
||||
val code: String,
|
||||
|
||||
@field:SerializedName("sysCodes")
|
||||
val sysCodes: Any,
|
||||
|
||||
@field:SerializedName("seqNo")
|
||||
val seqNo: Int,
|
||||
|
||||
@field:SerializedName("memo")
|
||||
val memo: Any,
|
||||
|
||||
@field:SerializedName("global")
|
||||
val global: Boolean,
|
||||
|
||||
@field:SerializedName("type")
|
||||
val type: String,
|
||||
|
||||
@field:SerializedName("parentType")
|
||||
val parentType: Any,
|
||||
|
||||
@field:SerializedName("parentCode")
|
||||
val parentCode: Any,
|
||||
|
||||
@field:SerializedName("codeChain")
|
||||
val codeChain: String,
|
||||
|
||||
@field:SerializedName("ifMaster")
|
||||
val ifMaster: Boolean,
|
||||
|
||||
@field:SerializedName("extra")
|
||||
val extra: Any,
|
||||
|
||||
@field:SerializedName("disabled")
|
||||
val disabled: Boolean,
|
||||
|
||||
@field:SerializedName("lockKey")
|
||||
val lockKey: String,
|
||||
|
||||
@field:SerializedName("id")
|
||||
val id: Int,
|
||||
|
||||
@field:SerializedName("text")
|
||||
val text: String,
|
||||
|
||||
@field:SerializedName("shortCode")
|
||||
val shortCode: String
|
||||
)
|
||||
@ -1,71 +0,0 @@
|
||||
package com.bjca.hp.acupuncture.model
|
||||
|
||||
|
||||
data class ItemsItems(
|
||||
val assessorName: String,
|
||||
val storehouseCode: String,
|
||||
val sysCode: String,
|
||||
val ifStateExpense: Boolean,
|
||||
val patientId: Int,
|
||||
val usage: String,
|
||||
val medicalAdvice: String,
|
||||
val dosagePerTime: String,
|
||||
val frequency: String,
|
||||
val approveUserId: Int,
|
||||
val itemName: String,
|
||||
val price: Double,
|
||||
val paymentId: Int,
|
||||
val patientAge: String,
|
||||
val cashierId: String,
|
||||
val lockKey: String,
|
||||
val id: Int,
|
||||
val ifInjury: Boolean,
|
||||
val paymentState: String,
|
||||
val invoiceNo: String,
|
||||
val barcode: String,
|
||||
val originalPaymentId: String,
|
||||
val diagnosis: String,
|
||||
val drugRpType: String,
|
||||
val originalInvoiceNo: String,
|
||||
val examineReason: String,
|
||||
val opNo: String,
|
||||
val name: String,
|
||||
val executorDeptCode: String,
|
||||
val assessorCode: String,
|
||||
val refundDate: String,
|
||||
val deptCode: String,
|
||||
val makeMethod: String,
|
||||
val distributeState: String,
|
||||
val rpFeeType: String,
|
||||
val no: String,
|
||||
val settleId: String,
|
||||
val approveDate: String,
|
||||
val originalNo: String,
|
||||
val patientGender: String,
|
||||
val appNo: String,
|
||||
val settleDate: String,
|
||||
val adviceNo: String,
|
||||
val doctorName: String,
|
||||
val rpSettleType: String,
|
||||
val doctorId: Int,
|
||||
val offsetState: String,
|
||||
val disabled: Boolean,
|
||||
val drugRestrict: String,
|
||||
val rpClass: String,
|
||||
val groupNo: String,
|
||||
val cashierName: String,
|
||||
val ifInsurance: Boolean,
|
||||
val examineResult: String,
|
||||
val patientName: String,
|
||||
val dosageUnit: String,
|
||||
val cost: Int,
|
||||
val quantity: String,
|
||||
val ifDivide: String,
|
||||
val excessDrugExplain: String,
|
||||
val approveUserName: String,
|
||||
val rpStatisticType: String,
|
||||
val days: String,
|
||||
val cashierCode: String,
|
||||
val paymentDate: String,
|
||||
val quantityPerDay: String
|
||||
)
|
||||
@ -1,15 +0,0 @@
|
||||
package com.bjca.hp.acupuncture.model
|
||||
|
||||
/***************************************************************************
|
||||
* <pre></pre>
|
||||
* @文件名称: MqMessage
|
||||
* @包 路 径: com.bjca.hp.acupuncture.model
|
||||
* @版权所有:北京数字医信责任有限公司 (C) 2022
|
||||
*
|
||||
* @类描述:
|
||||
* @版本: V1.0
|
||||
* @创建人: xuqm
|
||||
* @创建时间:2022/6/20 下午 05:06
|
||||
* @修改记录:
|
||||
*/
|
||||
data class MqMessage(val no:String)
|
||||
@ -1,168 +0,0 @@
|
||||
package com.bjca.hp.acupuncture.model
|
||||
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
data class RegModel(
|
||||
|
||||
@field:SerializedName("total")
|
||||
val total: Int,
|
||||
|
||||
@field:SerializedName("size")
|
||||
val size: Int,
|
||||
|
||||
@field:SerializedName("nulls")
|
||||
val nulls: String,
|
||||
|
||||
@field:SerializedName("index")
|
||||
val index: Int,
|
||||
|
||||
@field:SerializedName("items")
|
||||
val items: List<ItemsItem3>
|
||||
)
|
||||
|
||||
data class ItemsItem3(
|
||||
|
||||
@field:SerializedName("date")
|
||||
val date: String,
|
||||
|
||||
@field:SerializedName("additionUserId")
|
||||
val additionUserId: String,
|
||||
|
||||
@field:SerializedName("deptName")
|
||||
val deptName: String,
|
||||
|
||||
@field:SerializedName("seqNo")
|
||||
val seqNo: Int,
|
||||
|
||||
@field:SerializedName("patientId")
|
||||
val patientId: Int,
|
||||
|
||||
@field:SerializedName("signInDate")
|
||||
val signInDate: String,
|
||||
|
||||
@field:SerializedName("patientGender")
|
||||
val patientGender: String,
|
||||
|
||||
@field:SerializedName("opType")
|
||||
val opType: String,
|
||||
|
||||
@field:SerializedName("ifSubsequent")
|
||||
val ifSubsequent: Boolean,
|
||||
|
||||
@field:SerializedName("registrarName")
|
||||
val registrarName: String,
|
||||
|
||||
@field:SerializedName("ifDoctorAdd")
|
||||
val ifDoctorAdd: Boolean,
|
||||
|
||||
@field:SerializedName("cardNo")
|
||||
val cardNo: String,
|
||||
|
||||
@field:SerializedName("additionUserName")
|
||||
val additionUserName: String,
|
||||
|
||||
@field:SerializedName("treatDate")
|
||||
val treatDate: String,
|
||||
|
||||
@field:SerializedName("takingDate")
|
||||
val takingDate: String,
|
||||
|
||||
@field:SerializedName("ifDeleted")
|
||||
val ifDeleted: Boolean,
|
||||
|
||||
@field:SerializedName("doctorName")
|
||||
val doctorName: String,
|
||||
|
||||
@field:SerializedName("appointmentChannelCode")
|
||||
val appointmentChannelCode: String,
|
||||
|
||||
@field:SerializedName("lineNo")
|
||||
val lineNo: Double,
|
||||
|
||||
@field:SerializedName("doctorId")
|
||||
val doctorId: Int,
|
||||
|
||||
@field:SerializedName("price")
|
||||
val price: Double,
|
||||
|
||||
@field:SerializedName("ifAddition")
|
||||
val ifAddition: Boolean,
|
||||
|
||||
@field:SerializedName("patientAge")
|
||||
val patientAge: String,
|
||||
|
||||
@field:SerializedName("lockKey")
|
||||
val lockKey: String,
|
||||
|
||||
@field:SerializedName("id")
|
||||
val id: Int,
|
||||
|
||||
@field:SerializedName("state")
|
||||
val state: String,
|
||||
|
||||
@field:SerializedName("paymentState")
|
||||
val paymentState: String,
|
||||
|
||||
@field:SerializedName("regType")
|
||||
val regType: String,
|
||||
|
||||
@field:SerializedName("periodEnd")
|
||||
val periodEnd: String,
|
||||
|
||||
@field:SerializedName("registrarId")
|
||||
val registrarId: Int,
|
||||
|
||||
@field:SerializedName("patientName")
|
||||
val patientName: String,
|
||||
|
||||
@field:SerializedName("targetId")
|
||||
val targetId: String,
|
||||
|
||||
@field:SerializedName("cardType")
|
||||
val cardType: String,
|
||||
|
||||
@field:SerializedName("pay")
|
||||
val pay: Double,
|
||||
|
||||
@field:SerializedName("lineId")
|
||||
val lineId: Int,
|
||||
|
||||
@field:SerializedName("occupationalInjury")
|
||||
val occupationalInjury: String,
|
||||
|
||||
@field:SerializedName("version")
|
||||
val version: Int,
|
||||
|
||||
@field:SerializedName("patientPhone")
|
||||
val patientPhone: String,
|
||||
|
||||
@field:SerializedName("ifEmergency")
|
||||
val ifEmergency: Boolean,
|
||||
|
||||
@field:SerializedName("patientLevel")
|
||||
val patientLevel: String,
|
||||
|
||||
@field:SerializedName("periodType")
|
||||
val periodType: String,
|
||||
|
||||
@field:SerializedName("opNo")
|
||||
val opNo: String,
|
||||
|
||||
@field:SerializedName("ifMaternityInsurance")
|
||||
val ifMaternityInsurance: Boolean,
|
||||
|
||||
@field:SerializedName("periodStart")
|
||||
val periodStart: String,
|
||||
|
||||
@field:SerializedName("appointmentDate")
|
||||
val appointmentDate: String,
|
||||
|
||||
@field:SerializedName("appCardType")
|
||||
val appCardType: String,
|
||||
|
||||
@field:SerializedName("deptCode")
|
||||
val deptCode: String,
|
||||
|
||||
@field:SerializedName("appCardNo")
|
||||
val appCardNo: String
|
||||
)
|
||||
@ -1,153 +0,0 @@
|
||||
package com.bjca.hp.acupuncture.model
|
||||
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
data class RpDetailModel(
|
||||
|
||||
@field:SerializedName("total")
|
||||
val total: Int,
|
||||
|
||||
@field:SerializedName("size")
|
||||
val size: Int,
|
||||
|
||||
@field:SerializedName("nulls")
|
||||
val nulls: String,
|
||||
|
||||
@field:SerializedName("index")
|
||||
val index: Int,
|
||||
|
||||
@field:SerializedName("items")
|
||||
val items: List<ItemsItem2>
|
||||
)
|
||||
|
||||
data class ItemsItem2(
|
||||
|
||||
@field:SerializedName("shelfIndex")
|
||||
val shelfIndex: String,
|
||||
|
||||
@field:SerializedName("shelfCommand")
|
||||
val shelfCommand: String,
|
||||
|
||||
@field:SerializedName("standard")
|
||||
val standard: String,
|
||||
|
||||
@field:SerializedName("no")
|
||||
val no: String,
|
||||
|
||||
@field:SerializedName("storehouseCode")
|
||||
val storehouseCode: String,
|
||||
|
||||
@field:SerializedName("code")
|
||||
val code: String,
|
||||
|
||||
@field:SerializedName("usage")
|
||||
val usage: String,
|
||||
|
||||
@field:SerializedName("appNo")
|
||||
val appNo: String,
|
||||
|
||||
@field:SerializedName("memo")
|
||||
val memo: String,
|
||||
|
||||
@field:SerializedName("herbalSpecialUsage")
|
||||
val herbalSpecialUsage: String,
|
||||
|
||||
@field:SerializedName("restrict")
|
||||
val restrict: String,
|
||||
|
||||
@field:SerializedName("type")
|
||||
val type: String,
|
||||
|
||||
@field:SerializedName("dosagePerTime")
|
||||
val dosagePerTime: String,
|
||||
|
||||
@field:SerializedName("frequency")
|
||||
val frequency: String,
|
||||
|
||||
@field:SerializedName("insuranceCode")
|
||||
val insuranceCode: String,
|
||||
|
||||
@field:SerializedName("totalDose")
|
||||
val totalDose: String,
|
||||
|
||||
@field:SerializedName("times")
|
||||
val times: String,
|
||||
|
||||
@field:SerializedName("price")
|
||||
val price: Double,
|
||||
|
||||
@field:SerializedName("mnemonic")
|
||||
val mnemonic: String,
|
||||
|
||||
@field:SerializedName("offsetState")
|
||||
val offsetState: String,
|
||||
|
||||
@field:SerializedName("warning")
|
||||
val warning: String,
|
||||
|
||||
@field:SerializedName("lockKey")
|
||||
val lockKey: String,
|
||||
|
||||
@field:SerializedName("id")
|
||||
val id: Int,
|
||||
|
||||
@field:SerializedName("rpClass")
|
||||
val rpClass: String,
|
||||
|
||||
@field:SerializedName("groupNo")
|
||||
val groupNo: String,
|
||||
|
||||
@field:SerializedName("key")
|
||||
val key: String,
|
||||
|
||||
@field:SerializedName("dosageUnit")
|
||||
val dosageUnit: String,
|
||||
|
||||
@field:SerializedName("quantity")
|
||||
val quantity: Int,
|
||||
|
||||
@field:SerializedName("cost")
|
||||
val cost: Double,
|
||||
|
||||
@field:SerializedName("rpNo")
|
||||
val rpNo: String,
|
||||
|
||||
@field:SerializedName("lotNumber")
|
||||
val lotNumber: String,
|
||||
|
||||
@field:SerializedName("manufacturerCode")
|
||||
val manufacturerCode: String,
|
||||
|
||||
@field:SerializedName("approvalNumber")
|
||||
val approvalNumber: String,
|
||||
|
||||
@field:SerializedName("feeType")
|
||||
val feeType: String,
|
||||
|
||||
@field:SerializedName("unit")
|
||||
val unit: String,
|
||||
|
||||
@field:SerializedName("symptom")
|
||||
val symptom: String,
|
||||
|
||||
@field:SerializedName("form")
|
||||
val form: String,
|
||||
|
||||
@field:SerializedName("opNo")
|
||||
val opNo: String,
|
||||
|
||||
@field:SerializedName("name")
|
||||
val name: String,
|
||||
|
||||
@field:SerializedName("parts")
|
||||
val parts: String,
|
||||
|
||||
@field:SerializedName("days")
|
||||
val days: Int,
|
||||
|
||||
@field:SerializedName("executorDeptCode")
|
||||
val executorDeptCode: String,
|
||||
|
||||
@field:SerializedName("offsetId")
|
||||
val offsetId: Any
|
||||
)
|
||||
@ -1,21 +0,0 @@
|
||||
package com.bjca.hp.acupuncture.model
|
||||
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
data class RpModel(
|
||||
|
||||
@field:SerializedName("total")
|
||||
val total: Int,
|
||||
|
||||
@field:SerializedName("size")
|
||||
val size: Int,
|
||||
|
||||
@field:SerializedName("nulls")
|
||||
val nulls: Any,
|
||||
|
||||
@field:SerializedName("index")
|
||||
val index: Int,
|
||||
|
||||
@field:SerializedName("items")
|
||||
val items: List<ItemsItems>
|
||||
)
|
||||
@ -1,113 +0,0 @@
|
||||
package com.bjca.hp.acupuncture.model
|
||||
|
||||
import com.google.gson.annotations.SerializedName
|
||||
import com.xuqm.base.adapter.BaseItem
|
||||
import java.util.ArrayList
|
||||
|
||||
data class WelcomeLIstModel(
|
||||
|
||||
@field:SerializedName("total")
|
||||
val total: Int? = null,
|
||||
|
||||
@field:SerializedName("size")
|
||||
val size: Int? = null,
|
||||
|
||||
@field:SerializedName("nulls")
|
||||
val nulls: Any? = null,
|
||||
|
||||
@field:SerializedName("index")
|
||||
val index: Int? = null,
|
||||
|
||||
@field:SerializedName("items")
|
||||
val items: ArrayList<ItemsItem> = arrayListOf()
|
||||
)
|
||||
|
||||
data class ItemsItem(
|
||||
|
||||
@field:SerializedName("standard")
|
||||
val standard: String? = null,
|
||||
|
||||
@field:SerializedName("storehouseCode")
|
||||
val storehouseCode: String? = null,
|
||||
|
||||
@field:SerializedName("shelfIndex")
|
||||
val shelfIndex: Any? = null,
|
||||
|
||||
@field:SerializedName("code")
|
||||
val code: String? = null,
|
||||
|
||||
@field:SerializedName("purpose")
|
||||
val purpose: String? = null,
|
||||
|
||||
@field:SerializedName("supplierCode")
|
||||
val supplierCode: String? = null,
|
||||
|
||||
@field:SerializedName("herbalSku")
|
||||
val herbalSku: String? = null,
|
||||
|
||||
@field:SerializedName("type")
|
||||
val type: String? = null,
|
||||
|
||||
@field:SerializedName("restrict")
|
||||
val restrict: String? = null,
|
||||
|
||||
@field:SerializedName("rate")
|
||||
val rate: Double? = null,
|
||||
|
||||
@field:SerializedName("price")
|
||||
val price: Double? = null,
|
||||
|
||||
@field:SerializedName("srcId")
|
||||
val srcId: Any? = null,
|
||||
|
||||
@field:SerializedName("disabled")
|
||||
val disabled: Boolean? = null,
|
||||
|
||||
@field:SerializedName("lockKey")
|
||||
val lockKey: Any? = null,
|
||||
|
||||
@field:SerializedName("id")
|
||||
val id: Int? = null,
|
||||
|
||||
@field:SerializedName("applyQuantity")
|
||||
val applyQuantity: Double? = null,
|
||||
|
||||
@field:SerializedName("shortCode")
|
||||
val shortCode: String? = null,
|
||||
|
||||
@field:SerializedName("expirationDate")
|
||||
val expirationDate: String? = null,
|
||||
|
||||
@field:SerializedName("brandName")
|
||||
val brandName: String? = null,
|
||||
|
||||
@field:SerializedName("cost")
|
||||
val cost: Double? = null,
|
||||
|
||||
@field:SerializedName("quantity")
|
||||
val quantity: Double? = null,
|
||||
|
||||
@field:SerializedName("lotNumber")
|
||||
val lotNumber: String? = null,
|
||||
|
||||
@field:SerializedName("manufacturerCode")
|
||||
val manufacturerCode: String? = null,
|
||||
|
||||
@field:SerializedName("feeType")
|
||||
val feeType: Any? = null,
|
||||
|
||||
@field:SerializedName("approvalNumber")
|
||||
val approvalNumber: Any? = null,
|
||||
|
||||
@field:SerializedName("ceilType")
|
||||
val ceilType: String? = null,
|
||||
|
||||
@field:SerializedName("unit")
|
||||
val unit: String? = null,
|
||||
|
||||
@field:SerializedName("form")
|
||||
val form: String? = null,
|
||||
|
||||
@field:SerializedName("name")
|
||||
val name: String? = null
|
||||
) : BaseItem()
|
||||
@ -1,30 +0,0 @@
|
||||
package com.bjca.hp.acupuncture.receiver
|
||||
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import com.bjca.hp.acupuncture.ui.MainActivity
|
||||
|
||||
/***************************************************************************
|
||||
* <pre></pre>
|
||||
* @文件名称: BootCompleteReceiver
|
||||
* @包 路 径: com.bjca.hp.acupuncture.receiver
|
||||
* @版权所有:北京数字医信责任有限公司 (C) 2022
|
||||
*
|
||||
* @类描述:
|
||||
* @版本: V1.0
|
||||
* @创建人: xuqm
|
||||
* @创建时间:2022/6/24 下午 06:34
|
||||
* @修改记录:
|
||||
*/
|
||||
class BootCompleteReceiver : BroadcastReceiver(){
|
||||
override fun onReceive(context: Context, intent: Intent) {
|
||||
if(Intent.ACTION_BOOT_COMPLETED == intent.action){
|
||||
val thisIntent = Intent(context, MainActivity::class.java)
|
||||
thisIntent.action = "android.intent.action.MAIN";
|
||||
thisIntent.addCategory("android.intent.category.LAUNCHER");
|
||||
thisIntent.flags = Intent.FLAG_ACTIVITY_NEW_TASK;
|
||||
context.startActivity(thisIntent);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
package com.bjca.hp.acupuncture.repository
|
||||
package com.nova.brain.glass.repository
|
||||
|
||||
import android.content.Context
|
||||
import com.xuqm.base.common.SHARE_UESR_TOKEN
|
||||
@ -35,20 +35,6 @@ class HeaderInterceptor(val context: Context) : Interceptor {
|
||||
|
||||
val headers = request.headers()
|
||||
|
||||
// request.body()?.also {
|
||||
//
|
||||
// if (!bodyHasUnknownEncoding(headers)) {
|
||||
// val buffer = Buffer()
|
||||
// it.writeTo(buffer)
|
||||
//
|
||||
// var charset = Charset.forName("UTF-8")
|
||||
// it.contentType()?.also { its -> charset = its.charset(Charset.forName("UTF-8"))!! }
|
||||
//
|
||||
//// if (isPlaintext(buffer)) {
|
||||
//// buffer.readString(charset).loge()
|
||||
//// }
|
||||
// }
|
||||
// }
|
||||
val response = chain.proceed(request)
|
||||
|
||||
response.body()?.also {
|
||||
|
||||
@ -1,30 +1,8 @@
|
||||
package com.bjca.hp.acupuncture.repository
|
||||
|
||||
import com.bjca.hp.acupuncture.model.*
|
||||
import com.xuqm.sdhbwfu.core.model.HttpResult
|
||||
import io.reactivex.Observable
|
||||
import retrofit2.http.GET
|
||||
import retrofit2.http.Path
|
||||
import retrofit2.http.Query
|
||||
package com.nova.brain.glass.repository
|
||||
|
||||
|
||||
interface Service {
|
||||
@GET("drug/stock/standard?storehouseCode=2&type=&form=&purpose=&restrict=&danger=&antibiotic=&keyword=&manufacturerCode=&supplierCode=&expirationDateMin=&expirationDateMax=&sort=id&asc=false&papeIndexOnView=2&pageSize=20&tenantId=101")
|
||||
fun standard(@Query("pageIndex") pageIndex: Int): Observable<WelcomeLIstModel>
|
||||
// @GET("drug/stock/standard?storehouseCode=2&type=&form=&purpose=&restrict=&danger=&antibiotic=&keyword=&manufacturerCode=&supplierCode=&expirationDateMin=&expirationDateMax=&sort=id&asc=false&papeIndexOnView=2&pageSize=20&tenantId=101")
|
||||
// fun standard(@Query("pageIndex") pageIndex: Int): Observable<WelcomeLIstModel>
|
||||
|
||||
// op/rp?no=CF220609004247&rpClass=药品&tenantId=101
|
||||
@GET("op/rp?rpClass=药品&tenantId=101")
|
||||
fun rp(@Query("no") no: String): Observable<RpModel>
|
||||
|
||||
// op/rpDetail?opNo=MZ220321036030&rpNo=CF220323001947&tenantId=101
|
||||
@GET("op/rpDetail?tenantId=101")
|
||||
fun rpDetail(@Query("opNo") opNo: String, @Query("rpNo") rpNo: String): Observable<RpDetailModel>
|
||||
|
||||
// op/reg?opNo=MZ220321036030&tenantId=101
|
||||
@GET("op/reg?tenantId=101")
|
||||
fun reg(@Query("opNo") opNo: String): Observable<RegModel>
|
||||
|
||||
// dict/DrugUsage?sort=id&asc=false&pageIndexOnView=1&pageSize=100&dictType=DrugType&pageIndex=0
|
||||
@GET("dict/DrugUsage?sort=id&asc=false&pageIndexOnView=1&pageSize=100&dictType=DrugType&pageIndex=0")
|
||||
fun drugUsage(): Observable<DrugUsage>
|
||||
}
|
||||
@ -1,26 +1,11 @@
|
||||
package com.bjca.hp.acupuncture.ui
|
||||
package com.nova.brain.glass.ui
|
||||
|
||||
import android.graphics.Typeface
|
||||
import android.os.Bundle
|
||||
import androidx.activity.viewModels
|
||||
import com.bigkoo.alertview.AlertView
|
||||
import com.bjca.hp.acupuncture.MyApplication
|
||||
import com.bjca.hp.acupuncture.R
|
||||
import com.bjca.hp.acupuncture.databinding.ActivityMainBinding
|
||||
import com.bjca.hp.acupuncture.model.ItemsItem2
|
||||
import com.bjca.hp.acupuncture.model.ItemsItem3
|
||||
import com.bjca.hp.acupuncture.model.ItemsItem5
|
||||
import com.bjca.hp.acupuncture.model.ItemsItems
|
||||
import com.bjca.hp.acupuncture.viewmodel.MainVM
|
||||
import com.xuqm.base.adapter.CommonAdapter
|
||||
import com.xuqm.base.adapter.ViewHolder
|
||||
import com.xuqm.base.dialog.loading.LoadingDialog
|
||||
import com.xuqm.base.extensions.loge
|
||||
import com.nova.brain.glass.R
|
||||
import com.nova.brain.glass.databinding.ActivityMainBinding
|
||||
import com.nova.brain.glass.viewmodel.MainVM
|
||||
import com.xuqm.base.ui.BaseActivity
|
||||
import com.xuqm.sdhbwfu.core.extensions.linearLayoutManager
|
||||
import com.xuqm.sdhbwfu.core.extensions.showMessage
|
||||
import tp.xmaihh.serialport.SerialHelper
|
||||
import tp.xmaihh.serialport.bean.ComBean
|
||||
|
||||
class MainActivity : BaseActivity<ActivityMainBinding>() {
|
||||
override fun fullscreen(): Boolean = true
|
||||
@ -32,212 +17,6 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
|
||||
super.initView(savedInstanceState)
|
||||
|
||||
|
||||
sourceHanSansCNBold =
|
||||
Typeface.createFromAsset(mContext?.assets, "fonts/SourceHanSansCN-Bold.ttf")
|
||||
sourceHanSansCNMedium =
|
||||
Typeface.createFromAsset(mContext?.assets, "fonts/SourceHanSansCN-Medium.ttf")
|
||||
sourceHanSansCNNormal =
|
||||
Typeface.createFromAsset(mContext?.assets, "fonts/SourceHanSansCN-Normal.ttf")
|
||||
sourceHanSansCNRegular =
|
||||
Typeface.createFromAsset(mContext?.assets, "fonts/SourceHanSansCN-Regular.ttf")
|
||||
din =
|
||||
Typeface.createFromAsset(mContext?.assets, "fonts/DIN-Alternate-Bold.ttf")
|
||||
|
||||
binding.title.typeface = sourceHanSansCNBold
|
||||
binding.name.typeface = sourceHanSansCNBold
|
||||
binding.tags.typeface = sourceHanSansCNMedium
|
||||
binding.btn.typeface = sourceHanSansCNBold
|
||||
|
||||
binding.title1.typeface = sourceHanSansCNMedium
|
||||
binding.title2.typeface = sourceHanSansCNMedium
|
||||
binding.title3.typeface = sourceHanSansCNMedium
|
||||
binding.title5.typeface = sourceHanSansCNMedium
|
||||
|
||||
binding.n1.typeface = sourceHanSansCNRegular
|
||||
binding.v1.typeface = sourceHanSansCNRegular
|
||||
binding.n2.typeface = sourceHanSansCNRegular
|
||||
binding.v2.typeface = sourceHanSansCNRegular
|
||||
binding.n3.typeface = sourceHanSansCNRegular
|
||||
binding.v3.typeface = sourceHanSansCNRegular
|
||||
binding.n4.typeface = sourceHanSansCNRegular
|
||||
binding.v4.typeface = sourceHanSansCNRegular
|
||||
binding.n5.typeface = sourceHanSansCNRegular
|
||||
binding.v5.typeface = sourceHanSansCNRegular
|
||||
binding.n6.typeface = sourceHanSansCNRegular
|
||||
binding.v6.typeface = sourceHanSansCNRegular
|
||||
binding.n7.typeface = sourceHanSansCNRegular
|
||||
binding.v7.typeface = sourceHanSansCNRegular
|
||||
binding.n8.typeface = sourceHanSansCNRegular
|
||||
binding.v8.typeface = sourceHanSansCNRegular
|
||||
binding.n9.typeface = sourceHanSansCNRegular
|
||||
binding.v9.typeface = sourceHanSansCNRegular
|
||||
binding.n10.typeface = sourceHanSansCNRegular
|
||||
binding.v10.typeface = sourceHanSansCNRegular
|
||||
binding.n11.typeface = sourceHanSansCNRegular
|
||||
binding.v11.typeface = sourceHanSansCNRegular
|
||||
binding.n12.typeface = sourceHanSansCNRegular
|
||||
binding.v12.typeface = sourceHanSansCNRegular
|
||||
binding.n13.typeface = sourceHanSansCNRegular
|
||||
binding.v13.typeface = sourceHanSansCNRegular
|
||||
binding.n14.typeface = sourceHanSansCNRegular
|
||||
binding.v14.typeface = sourceHanSansCNRegular
|
||||
binding.n15.typeface = sourceHanSansCNRegular
|
||||
binding.v15.typeface = sourceHanSansCNRegular
|
||||
binding.n16.typeface = sourceHanSansCNRegular
|
||||
binding.v16.typeface = sourceHanSansCNRegular
|
||||
binding.n17.typeface = sourceHanSansCNRegular
|
||||
binding.v17.typeface = sourceHanSansCNRegular
|
||||
|
||||
|
||||
binding.list.linearLayoutManager(mContext, 15)
|
||||
binding.list.adapter = adapter
|
||||
|
||||
|
||||
binding.btn.setOnClickListener {
|
||||
LoadingDialog.showDialog("")
|
||||
|
||||
if (adapter.datas.size > 0)
|
||||
sndMessage(0)
|
||||
else {
|
||||
// s.sendHex("0105002cff004DF3"); // 发送Hex
|
||||
|
||||
MyApplication.getInstance().runOnUiThreadDelay({
|
||||
try {
|
||||
s.sendHex("02050001ff00DDC9"); // 发送Hex
|
||||
} catch (e: Exception) {
|
||||
e.showMessage()
|
||||
}
|
||||
LoadingDialog.dismissDialog()
|
||||
}, 500)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private fun sndMessage(i: Int) {
|
||||
if (i >= adapter.datas.size) {
|
||||
LoadingDialog.dismissDialog()
|
||||
AlertView(
|
||||
"取药完成", adapter.datas.map { it.shelfIndex}.joinToString(), null, arrayOf("确定"), null, mContext,
|
||||
AlertView.Style.Alert
|
||||
) { _, _ ->
|
||||
mContext.finish()
|
||||
}.show()
|
||||
return
|
||||
}
|
||||
try {
|
||||
s.sendHex(adapter.datas[i].shelfCommand); // 发送Hex
|
||||
} catch (e: Exception) {
|
||||
e.showMessage()
|
||||
}
|
||||
MyApplication.getInstance().runOnUiThreadDelay({
|
||||
sndMessage(i + 1)
|
||||
}, 2300)
|
||||
|
||||
}
|
||||
|
||||
lateinit var sourceHanSansCNBold: Typeface
|
||||
lateinit var sourceHanSansCNMedium: Typeface
|
||||
lateinit var sourceHanSansCNNormal: Typeface
|
||||
lateinit var sourceHanSansCNRegular: Typeface
|
||||
lateinit var din: Typeface
|
||||
|
||||
var rp: ItemsItems? = null
|
||||
var regM: ItemsItem3? = null
|
||||
var usages: List<ItemsItem5> = listOf()
|
||||
lateinit var s: SerialHelper
|
||||
override fun initData() {
|
||||
super.initData()
|
||||
s = object : SerialHelper("/dev/ttyS0", 38400) {
|
||||
override fun onDataReceived(paramComBean: ComBean?) {
|
||||
paramComBean?.bRec?.loge()
|
||||
}
|
||||
}
|
||||
try {
|
||||
s.open()
|
||||
} catch (e: Exception) {
|
||||
e.showMessage()
|
||||
}
|
||||
|
||||
vm.status.observe(this) {
|
||||
rp = it
|
||||
rerresh()
|
||||
}
|
||||
vm.regM.observe(this) {
|
||||
regM = it
|
||||
rerresh()
|
||||
}
|
||||
vm.usages.observe(this) {
|
||||
usages = it ?: listOf()
|
||||
intent.getStringExtra("opNo")?.let { it1 -> vm.getRp(it1) }
|
||||
}
|
||||
vm.rpDetail.observe(this) {
|
||||
adapter.setmDatas(it)
|
||||
}
|
||||
vm.drugUsage()
|
||||
}
|
||||
|
||||
fun getUsage(code: String): String {
|
||||
var text = "--"
|
||||
usages.forEach {
|
||||
if (it.code == code) {
|
||||
text = it.text
|
||||
}
|
||||
}
|
||||
return text
|
||||
}
|
||||
|
||||
private fun rerresh() {
|
||||
rp?.let {
|
||||
binding.v8.text = it.diagnosis
|
||||
binding.v14.text = it.doctorName
|
||||
binding.v16.text = "${it.price}元"
|
||||
binding.v13.text = it.approveUserName
|
||||
binding.v11.text = it.no
|
||||
}
|
||||
regM?.let {
|
||||
binding.v1.text = it.patientName
|
||||
binding.v2.text = it.patientGender
|
||||
binding.v3.text = "${it.patientAge}"
|
||||
binding.v4.text = it.patientPhone
|
||||
binding.v5.text = ""
|
||||
|
||||
binding.v6.text = it.appCardNo
|
||||
binding.v7.text = it.deptName
|
||||
binding.v9.text = it.date
|
||||
binding.v10.text = it.opType
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private val adapter = object : CommonAdapter<ItemsItem2>(R.layout.item_main) {
|
||||
override fun convert(holder: ViewHolder, item: ItemsItem2, position: Int) {
|
||||
|
||||
holder.setTypeface(R.id.index, sourceHanSansCNMedium)
|
||||
.setText(R.id.index, "${position + 1}")
|
||||
.setTypeface(R.id.n1, sourceHanSansCNRegular)
|
||||
.setTypeface(R.id.v1, sourceHanSansCNRegular)
|
||||
.setText(R.id.v1, item.name)//名称
|
||||
.setTypeface(R.id.n2, sourceHanSansCNRegular)
|
||||
.setTypeface(R.id.v1, sourceHanSansCNRegular)
|
||||
.setText(R.id.v2, item.standard)//规格
|
||||
.setTypeface(R.id.n3, sourceHanSansCNRegular)
|
||||
.setTypeface(R.id.v3, sourceHanSansCNRegular)
|
||||
.setText(R.id.v3, "${item.quantity}${item.unit}")//数量
|
||||
.setTypeface(R.id.n4, sourceHanSansCNRegular)
|
||||
.setTypeface(R.id.v4, sourceHanSansCNRegular)
|
||||
.setText(R.id.v4, getUsage(item.usage))//使用方法---码表
|
||||
.setTypeface(R.id.n5, sourceHanSansCNRegular)
|
||||
.setTypeface(R.id.v5, sourceHanSansCNRegular)
|
||||
.setText(R.id.v5, "${item.dosagePerTime}${item.dosageUnit}")//用量
|
||||
.setTypeface(R.id.n6, sourceHanSansCNRegular)
|
||||
.setTypeface(R.id.v6, sourceHanSansCNRegular)
|
||||
.setText(R.id.v6, item.frequency)//频次---码表
|
||||
.setTypeface(R.id.n7, sourceHanSansCNRegular)
|
||||
.setTypeface(R.id.v7, sourceHanSansCNRegular)
|
||||
.setText(R.id.v7, "${item.days}天")//使用周期
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,209 +0,0 @@
|
||||
package com.bjca.hp.acupuncture.ui
|
||||
|
||||
import android.os.Bundle
|
||||
import com.bjca.hp.acupuncture.MyApplication
|
||||
import com.bjca.hp.acupuncture.R
|
||||
import com.bjca.hp.acupuncture.databinding.ActivitySettingBinding
|
||||
import com.xuqm.base.extensions.loge
|
||||
import com.xuqm.base.ui.BaseActivity
|
||||
import com.xuqm.sdhbwfu.core.extensions.showMessage
|
||||
import kotlinx.android.synthetic.main.activity_setting.*
|
||||
import tp.xmaihh.serialport.SerialHelper
|
||||
import tp.xmaihh.serialport.bean.ComBean
|
||||
import java.util.*
|
||||
|
||||
class SettingActivity : BaseActivity<ActivitySettingBinding>() {
|
||||
override fun getLayoutId(): Int = R.layout.activity_setting
|
||||
override fun initView(savedInstanceState: Bundle?) {
|
||||
super.initView(savedInstanceState)
|
||||
binding.a13.setOnClickListener {
|
||||
|
||||
val a11 = binding.a11.text.toString().toInt()
|
||||
if (a11 <= 0 || a11 > 9) {
|
||||
"请输入正确的柜号,从1开始".showMessage()
|
||||
return@setOnClickListener
|
||||
}
|
||||
val a12 = binding.a12.text.toString().toInt()
|
||||
if (a12 <= 0) {
|
||||
"请输入正确的柜门号,从1开始".showMessage()
|
||||
return@setOnClickListener
|
||||
}
|
||||
val b1 = "0${a11}05${intToHex(a12, 4)}ff00"
|
||||
val b2 = getCRC(b1)
|
||||
try {
|
||||
s.sendHex("${b1}${b2}"); // 发送Hex
|
||||
} catch (e: Exception) {
|
||||
e.showMessage()
|
||||
}
|
||||
|
||||
}
|
||||
binding.a24.setOnClickListener {
|
||||
|
||||
val a21 = binding.a21.text.toString().toInt()
|
||||
if (a21 <= 0 || a21 > 9) {
|
||||
"请输入正确的柜号,从1开始".showMessage()
|
||||
return@setOnClickListener
|
||||
}
|
||||
val a22 = binding.a22.text.toString().toInt()
|
||||
if (a22 <= 0) {
|
||||
"请输入正确的柜门号,从1开始".showMessage()
|
||||
return@setOnClickListener
|
||||
}
|
||||
val a23 = binding.a23.text.toString().toInt()
|
||||
if (a23 <= 0) {
|
||||
"请输入正确的柜门号,从1开始".showMessage()
|
||||
return@setOnClickListener
|
||||
}
|
||||
|
||||
sndMessage(a21, a22, a23)
|
||||
|
||||
}
|
||||
binding.a31.setOnClickListener {
|
||||
sndMessage(1, 1, 84)
|
||||
}
|
||||
binding.a32.setOnClickListener {
|
||||
sndMessage(2, 1, 84)
|
||||
}
|
||||
binding.a33.setOnClickListener {
|
||||
sndMessage(3, 1, 84)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private fun sndMessage(i: Int, ii: Int, iii: Int) {
|
||||
if (ii > iii) return
|
||||
val b1 = "0${i}05${intToHex(ii, 4)}ff00"
|
||||
val b2 = getCRC(b1)
|
||||
try {
|
||||
s.sendHex("${b1}${b2}"); // 发送Hex
|
||||
} catch (e: Exception) {
|
||||
e.showMessage()
|
||||
}
|
||||
MyApplication.getInstance().runOnUiThreadDelay({
|
||||
sndMessage(i, ii + 1, iii)
|
||||
}, 2300)
|
||||
|
||||
}
|
||||
|
||||
|
||||
lateinit var s: SerialHelper
|
||||
override fun initData() {
|
||||
super.initData()
|
||||
s = object : SerialHelper("/dev/ttyS0", 38400) {
|
||||
override fun onDataReceived(paramComBean: ComBean?) {
|
||||
paramComBean?.bRec?.loge()
|
||||
}
|
||||
}
|
||||
try {
|
||||
s.open()
|
||||
} catch (e: Exception) {
|
||||
e.showMessage()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 10进制转16进制.
|
||||
*
|
||||
* @param n 10进制数
|
||||
* @param size 转换后的16进制位数
|
||||
* @return 转换结果
|
||||
*/
|
||||
private fun intToHex(n: Int, size: Int): String {
|
||||
var n = n
|
||||
var s = StringBuffer()
|
||||
var a: String
|
||||
val b = charArrayOf(
|
||||
'0',
|
||||
'1',
|
||||
'2',
|
||||
'3',
|
||||
'4',
|
||||
'5',
|
||||
'6',
|
||||
'7',
|
||||
'8',
|
||||
'9',
|
||||
'A',
|
||||
'B',
|
||||
'C',
|
||||
'D',
|
||||
'E',
|
||||
'F'
|
||||
)
|
||||
while (n != 0) {
|
||||
s = s.append(b[n % 16])
|
||||
n = n / 16
|
||||
}
|
||||
a = s.reverse().toString()
|
||||
a = add_zero(a, size)
|
||||
return a
|
||||
}
|
||||
|
||||
fun add_zero(str: String, size: Int): String {
|
||||
var str = str
|
||||
if (str.length < size) {
|
||||
str = "0$str"
|
||||
str = add_zero(str, size)
|
||||
}
|
||||
return str
|
||||
}
|
||||
|
||||
|
||||
fun getCRC(data: String): String {
|
||||
var data = data
|
||||
data = data.replace(" ", "")
|
||||
val len = data.length
|
||||
if (len % 2 != 0) {
|
||||
return "0000"
|
||||
}
|
||||
val num = len / 2
|
||||
val para = ByteArray(num)
|
||||
for (i in 0 until num) {
|
||||
val value = Integer.valueOf(data.substring(i * 2, 2 * (i + 1)), 16)
|
||||
para[i] = value.toByte()
|
||||
}
|
||||
return getCRC(para)
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算CRC16校验码
|
||||
*
|
||||
* @param bytes
|
||||
* 字节数组
|
||||
* @return [String] 校验码
|
||||
* @since 1.0
|
||||
*/
|
||||
fun getCRC(bytes: ByteArray): String {
|
||||
// CRC寄存器全为1
|
||||
var CRC = 0x0000ffff
|
||||
// 多项式校验值
|
||||
val POLYNOMIAL = 0x0000a001
|
||||
var i: Int
|
||||
var j: Int
|
||||
i = 0
|
||||
while (i < bytes.size) {
|
||||
CRC = CRC xor (bytes[i].toInt() and 0x000000ff)
|
||||
j = 0
|
||||
while (j < 8) {
|
||||
if (CRC and 0x00000001 != 0) {
|
||||
CRC = CRC shr 1
|
||||
CRC = CRC xor POLYNOMIAL
|
||||
} else {
|
||||
CRC = CRC shr 1
|
||||
}
|
||||
j++
|
||||
}
|
||||
i++
|
||||
}
|
||||
// 结果转换为16进制
|
||||
var result = Integer.toHexString(CRC).uppercase(Locale.getDefault())
|
||||
if (result.length != 4) {
|
||||
val sb = StringBuffer("0000")
|
||||
result = sb.replace(4 - result.length, 4, result).toString()
|
||||
}
|
||||
//高位在前地位在后
|
||||
//return result.substring(2, 4) + " " + result.substring(0, 2);
|
||||
// 交换高低位,低位在前高位在后
|
||||
return result.substring(2, 4) + result.substring(0, 2)
|
||||
}
|
||||
}
|
||||
@ -1,35 +0,0 @@
|
||||
package com.bjca.hp.acupuncture.ui
|
||||
|
||||
import android.os.Bundle
|
||||
import com.bjca.hp.acupuncture.R
|
||||
import com.bjca.hp.acupuncture.databinding.ActivityTestBinding
|
||||
import com.xuqm.base.common.ToolsHelper
|
||||
import com.xuqm.base.extensions.getStringForPreferences
|
||||
import com.xuqm.base.extensions.putString
|
||||
import com.xuqm.base.ui.BaseActivity
|
||||
import com.xuqm.base.web.XWebViewHelper
|
||||
|
||||
class TestActivity : BaseActivity<ActivityTestBinding>() {
|
||||
override fun getLayoutId(): Int = R.layout.activity_test
|
||||
override fun initView(savedInstanceState: Bundle?) {
|
||||
super.initView(savedInstanceState)
|
||||
|
||||
val str = getStringForPreferences("wurl")
|
||||
if (!ToolsHelper.isNull(str))
|
||||
binding.editUrl.setText(str)
|
||||
|
||||
binding.btn.setOnClickListener {
|
||||
|
||||
val url =
|
||||
if (ToolsHelper.isNull(binding.editUrl.text)) "https://web.sdk.qcloud.com/trtc/webrtc/demo/quick-demo-vue3-ts/index.html#/"
|
||||
else binding.editUrl.text.toString()
|
||||
|
||||
putString("wurl", url)
|
||||
XWebViewHelper.startWebNoTopBar(
|
||||
mContext,
|
||||
url
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,166 +1,19 @@
|
||||
package com.bjca.hp.acupuncture.ui
|
||||
package com.nova.brain.glass.ui
|
||||
|
||||
import android.content.Intent
|
||||
import android.graphics.Typeface
|
||||
import android.os.Bundle
|
||||
import com.bjca.hp.acupuncture.R
|
||||
import com.bjca.hp.acupuncture.common.RabbitMQUtil
|
||||
import com.bjca.hp.acupuncture.databinding.ActivityWelcomeBinding
|
||||
import com.bjca.hp.acupuncture.model.ItemsItem
|
||||
import com.bjca.hp.acupuncture.viewmodel.WelcomeVM
|
||||
import com.xuqm.base.adapter.BasePagedAdapter
|
||||
import com.xuqm.base.adapter.CommonPagedAdapter
|
||||
import com.xuqm.base.adapter.ViewHolder
|
||||
import com.xuqm.base.ui.BaseListFormLayoutActivity
|
||||
import com.xuqm.sdhbwfu.core.extensions.gridLayoutManager
|
||||
import com.xuqm.sdhbwfu.core.extensions.runWithPermission
|
||||
import com.xuqm.sdhbwfu.core.extensions.toStrings
|
||||
import com.nova.brain.glass.R
|
||||
import com.nova.brain.glass.databinding.ActivityWelcomeBinding
|
||||
import com.xuqm.base.ui.BaseActivity
|
||||
|
||||
class WelcomeActivity : BaseListFormLayoutActivity<ItemsItem, WelcomeVM, ActivityWelcomeBinding>() {
|
||||
class WelcomeActivity : BaseActivity<ActivityWelcomeBinding>() {
|
||||
|
||||
override fun getLayoutId(): Int = R.layout.activity_welcome
|
||||
override fun fullscreen(): Boolean = true
|
||||
|
||||
// lateinit var s: SerialHelper
|
||||
|
||||
lateinit var sourceHanSansCNBold: Typeface
|
||||
lateinit var sourceHanSansCNMedium: Typeface
|
||||
lateinit var sourceHanSansCNNormal: Typeface
|
||||
lateinit var din: Typeface
|
||||
lateinit var mq: RabbitMQUtil
|
||||
|
||||
private var oldTime = 0L
|
||||
private var index = 0
|
||||
|
||||
override fun initView(savedInstanceState: Bundle?) {
|
||||
super.initView(savedInstanceState)
|
||||
|
||||
sourceHanSansCNBold =
|
||||
Typeface.createFromAsset(mContext?.assets, "fonts/SourceHanSansCN-Bold.ttf")
|
||||
sourceHanSansCNMedium =
|
||||
Typeface.createFromAsset(mContext?.assets, "fonts/SourceHanSansCN-Medium.ttf")
|
||||
sourceHanSansCNNormal =
|
||||
Typeface.createFromAsset(mContext?.assets, "fonts/SourceHanSansCN-Normal.ttf")
|
||||
din =
|
||||
Typeface.createFromAsset(mContext?.assets, "fonts/DIN-Alternate-Bold.ttf")
|
||||
|
||||
|
||||
binding.title.typeface = sourceHanSansCNBold
|
||||
|
||||
binding.title.setOnClickListener {
|
||||
val newTime = System.currentTimeMillis()
|
||||
if (newTime - oldTime < 2500 && oldTime != 0L) {
|
||||
if (index > 5) {
|
||||
startActivity(Intent(mContext, SettingActivity::class.java))
|
||||
index = 0
|
||||
}
|
||||
index++
|
||||
} else {
|
||||
oldTime = newTime
|
||||
index = 0
|
||||
}
|
||||
}
|
||||
|
||||
// binding.list.gridLayoutManager(mContext, 6, 2)
|
||||
// binding.list.adapter = adapter
|
||||
|
||||
// adapter.setmDatas(arrayListOf("空调", "水泵", "空气净化器", "阳台", "灯"))
|
||||
recyclerView.gridLayoutManager(mContext, 21, 3)
|
||||
|
||||
|
||||
adapter.setItemLongClickListener { _, _, _ ->
|
||||
startActivity(Intent(mContext, MainActivity::class.java))
|
||||
return@setItemLongClickListener true
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
mq.close()
|
||||
}
|
||||
|
||||
override fun initData() {
|
||||
super.initData()
|
||||
|
||||
|
||||
runWithPermission(
|
||||
"android.permission.MODIFY_AUDIO_SETTINGS",
|
||||
"android.permission.RECORD_AUDIO",
|
||||
"android.permission.CAMERA"
|
||||
) {
|
||||
startActivity(Intent(mContext, TestActivity::class.java))
|
||||
}
|
||||
|
||||
// XWebViewHelper.startWebNoTopBar(mContext,"https://mdtdemo.51trust.com/")
|
||||
// mq = RabbitMQUtil("10.10.202.11", 5672, "guest", "guest")
|
||||
//
|
||||
// mq.receiveQueueMessage("RpNoByMedicineCabinet",
|
||||
// {
|
||||
//
|
||||
// startActivity(Intent(mContext, MainActivity::class.java)
|
||||
// .apply {
|
||||
// putExtra(
|
||||
// "opNo",
|
||||
// GsonImplHelp.get().toObject(it, MqMessage::class.java).no
|
||||
// )
|
||||
// })
|
||||
// }
|
||||
// ) {
|
||||
// it.loge()
|
||||
// }
|
||||
|
||||
// s = object : SerialHelper("/dev/ttyS0", 38400) {
|
||||
// override fun onDataReceived(paramComBean: ComBean?) {
|
||||
// paramComBean?.bRec?.loge()
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// s.setStickPackageHelper {
|
||||
// try {
|
||||
// val available = it.available()
|
||||
// if (available > 0) {
|
||||
// val buffer = ByteArray(available)
|
||||
// val size = it.read(buffer)
|
||||
// if (size > 0) {
|
||||
// return@setStickPackageHelper buffer;
|
||||
// }
|
||||
// } else {
|
||||
// SystemClock.sleep(50);
|
||||
// }
|
||||
//
|
||||
// } catch (e: IOException) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// return@setStickPackageHelper null
|
||||
// }
|
||||
|
||||
// s.sendHex("02050001ff00DDC9"); // 发送Hex
|
||||
|
||||
}
|
||||
|
||||
|
||||
private val adapter = object : CommonPagedAdapter<ItemsItem>(R.layout.item_welcome) {
|
||||
override fun convert(holder: ViewHolder, item: ItemsItem, position: Int) {
|
||||
holder
|
||||
.setTypeface(R.id.index, sourceHanSansCNMedium)
|
||||
.setTypeface(R.id.name, sourceHanSansCNBold)
|
||||
.setTypeface(R.id.hint, sourceHanSansCNNormal)
|
||||
.setTypeface(R.id.number, din)
|
||||
.setTypeface(R.id.unit, sourceHanSansCNNormal)
|
||||
.setTypeface(R.id.balance, sourceHanSansCNNormal)
|
||||
.setText(R.id.index, "${position + 1}")
|
||||
.setText(R.id.name, item.name)
|
||||
.setText(R.id.hint, item.supplierCode)
|
||||
.setText(R.id.number, item.price?.toStrings())
|
||||
.setText(R.id.unit, "元/${item.unit}")
|
||||
.setText(R.id.balance, "剩余:${item.quantity}${item.unit}")
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
override fun adapter(): BasePagedAdapter<ItemsItem> = adapter
|
||||
|
||||
|
||||
}
|
||||
@ -1,104 +1,7 @@
|
||||
package com.bjca.hp.acupuncture.viewmodel
|
||||
package com.nova.brain.glass.viewmodel
|
||||
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import com.bjca.hp.acupuncture.MyApplication
|
||||
import com.bjca.hp.acupuncture.model.ItemsItem2
|
||||
import com.bjca.hp.acupuncture.model.ItemsItem3
|
||||
import com.bjca.hp.acupuncture.model.ItemsItem5
|
||||
import com.bjca.hp.acupuncture.model.ItemsItems
|
||||
import com.bjca.hp.acupuncture.repository.Service
|
||||
import com.xuqm.base.di.manager.HttpManager
|
||||
import com.xuqm.base.extensions.showMessage
|
||||
import com.xuqm.sdhbwfu.core.viewModel.BaseViewModel
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.schedulers.Schedulers
|
||||
|
||||
/***************************************************************************
|
||||
* <pre></pre>
|
||||
* @文件名称: WelcomeVM
|
||||
* @包 路 径: com.bjca.hp.acupuncture.viewmodel
|
||||
* @版权所有:北京数字医信责任有限公司 (C) 2022
|
||||
*
|
||||
* @类描述:
|
||||
* @版本: V1.0
|
||||
* @创建人: xuqm
|
||||
* @创建时间:2022/6/17 下午 02:33
|
||||
* @修改记录:
|
||||
*/
|
||||
|
||||
class MainVM : BaseViewModel() {
|
||||
|
||||
|
||||
private val _status = MutableLiveData<ItemsItems>()
|
||||
val status: LiveData<ItemsItems> = _status
|
||||
|
||||
fun getRp(opNo:String = "CF220609004247" ) {
|
||||
HttpManager.getApi(MyApplication.appComponent1, Service::class.java)
|
||||
.rp(opNo)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(
|
||||
{
|
||||
_status.postValue(it.items[0])
|
||||
rpDetail(it.items[0].opNo, it.items[0].no)
|
||||
reg(it.items[0].opNo)
|
||||
}, {
|
||||
_status.postValue(null)
|
||||
showMessage(it.toString())
|
||||
}
|
||||
).adds()
|
||||
}
|
||||
|
||||
private val _rpDetail = MutableLiveData<List<ItemsItem2>>()
|
||||
val rpDetail: LiveData<List<ItemsItem2>> = _rpDetail
|
||||
|
||||
fun rpDetail(opNo: String, rpNo: String) {
|
||||
HttpManager.getApi(MyApplication.appComponent1, Service::class.java)
|
||||
.rpDetail(opNo, rpNo)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(
|
||||
{
|
||||
_rpDetail.postValue(it.items)
|
||||
}, {
|
||||
_rpDetail.postValue(null)
|
||||
showMessage(it.toString())
|
||||
}
|
||||
).adds()
|
||||
}
|
||||
|
||||
private val _regM = MutableLiveData<ItemsItem3>()
|
||||
val regM: LiveData<ItemsItem3> = _regM
|
||||
fun reg(opNo: String) {
|
||||
HttpManager.getApi(MyApplication.appComponent1, Service::class.java)
|
||||
.reg(opNo)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(
|
||||
{
|
||||
_regM.postValue(it?.items?.get(0))
|
||||
}, {
|
||||
_regM.postValue(null)
|
||||
showMessage(it.toString())
|
||||
}
|
||||
).adds()
|
||||
}
|
||||
|
||||
private val _usages = MutableLiveData<List<ItemsItem5>>()
|
||||
val usages: LiveData<List<ItemsItem5>> = _usages
|
||||
fun drugUsage() {
|
||||
HttpManager.getApi(MyApplication.appComponent2, Service::class.java)
|
||||
.drugUsage()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(
|
||||
{
|
||||
_usages.postValue(it.items)
|
||||
}, {
|
||||
_usages.postValue(null)
|
||||
showMessage(it.toString())
|
||||
}
|
||||
).adds()
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,40 +1,6 @@
|
||||
package com.bjca.hp.acupuncture.viewmodel
|
||||
package com.nova.brain.glass.viewmodel
|
||||
|
||||
import com.bjca.hp.acupuncture.model.ItemsItem
|
||||
import com.bjca.hp.acupuncture.repository.Service
|
||||
import com.xuqm.base.di.manager.HttpManager
|
||||
import com.xuqm.base.extensions.showMessage
|
||||
import com.xuqm.base.viewmodel.BaseListViewModel
|
||||
import com.xuqm.base.viewmodel.callback.Response
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.schedulers.Schedulers
|
||||
import com.xuqm.sdhbwfu.core.viewModel.BaseViewModel
|
||||
|
||||
/***************************************************************************
|
||||
* <pre></pre>
|
||||
* @文件名称: WelcomeVM
|
||||
* @包 路 径: com.bjca.hp.acupuncture.viewmodel
|
||||
* @版权所有:北京数字医信责任有限公司 (C) 2022
|
||||
*
|
||||
* @类描述:
|
||||
* @版本: V1.0
|
||||
* @创建人: xuqm
|
||||
* @创建时间:2022/6/17 下午 02:33
|
||||
* @修改记录:
|
||||
*/
|
||||
class WelcomeVM : BaseListViewModel<ItemsItem>() {
|
||||
override fun loadData(page: Int, onResponse: Response<ItemsItem>) {
|
||||
add(
|
||||
HttpManager.getApi(Service::class.java)
|
||||
.standard(page)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(
|
||||
{
|
||||
onResponse.onResponse(it.items)
|
||||
}, {
|
||||
onResponse.onResponse(null)
|
||||
// showMessage(it)
|
||||
}
|
||||
))
|
||||
}
|
||||
class WelcomeVM : BaseViewModel() {
|
||||
}
|
||||
@ -1,22 +0,0 @@
|
||||
package com.bjca.hp.acupuncture.widget;
|
||||
|
||||
import androidx.annotation.ColorInt;
|
||||
|
||||
/***************************************************************************
|
||||
* <pre></pre>
|
||||
* @文件名称: ColorUser
|
||||
* @包 路 径: com.bjca.hp.acupuncture.widget
|
||||
* @版权所有:北京数字医信责任有限公司 (C) 2022
|
||||
*
|
||||
* @类描述:
|
||||
* @版本: V1.0
|
||||
* @创建人: xuqm
|
||||
* @创建时间:2022/1/19 上午 10:58
|
||||
* @修改记录:
|
||||
*/
|
||||
public class ColorUser {
|
||||
@ColorInt
|
||||
public static final int ce = 0xFF04E8EE;
|
||||
@ColorInt
|
||||
public static final int cs = 0x003A6FF2;
|
||||
}
|
||||
@ -1,11 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:tools="http://schemas.android.com/tools" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<stroke android:width="0.5dp" android:color="#00000014" />
|
||||
<corners android:radius="5dp" />
|
||||
<solid android:color="@color/white"/>
|
||||
</shape>
|
||||
|
||||
</item>
|
||||
</selector>
|
||||
@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:tools="http://schemas.android.com/tools" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="1dp" />
|
||||
<solid android:color="#F1F9F5"/>
|
||||
</shape>
|
||||
|
||||
</item>
|
||||
</selector>
|
||||
@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="2dp" />
|
||||
<solid android:color="#BA7D45" />
|
||||
</shape>
|
||||
|
||||
</item>
|
||||
</selector>
|
||||
@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:bottomRightRadius="1dp" android:topRightRadius="1dp" />
|
||||
<solid android:color="#FFFFFF" />
|
||||
</shape>
|
||||
|
||||
</item>
|
||||
</selector>
|
||||
@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:bottomLeftRadius="1dp" android:topLeftRadius="1dp" />
|
||||
<solid android:color="#BA7D45" />
|
||||
</shape>
|
||||
|
||||
</item>
|
||||
</selector>
|
||||
@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:tools="http://schemas.android.com/tools" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="1dp" />
|
||||
<stroke android:width="1dp" android:color="#5EA564" />
|
||||
</shape>
|
||||
|
||||
</item>
|
||||
</selector>
|
||||
@ -5,694 +5,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#BA7D45"
|
||||
tools:context=".ui.MainActivity">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:gravity="center"
|
||||
android:text="联创明医医院智慧药柜"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="15dp"
|
||||
android:layout_marginTop="76dp"
|
||||
android:background="@drawable/bg_main"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
android:background="@drawable/bg_main"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="广州黄埔区明医医院处方笺"
|
||||
android:textColor="#202020"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tags"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="17.5dp"
|
||||
android:background="@drawable/bg_main_tag"
|
||||
android:paddingHorizontal="7.5dp"
|
||||
android:paddingVertical="4.5dp"
|
||||
android:text="普通"
|
||||
android:textColor="#5EA564" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:orientation="horizontal"
|
||||
android:paddingHorizontal="15dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="3"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="4dp"
|
||||
android:background="#BA7D45"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/title1"
|
||||
app:layout_constraintEnd_toEndOf="@+id/title1"
|
||||
app:layout_constraintStart_toStartOf="@+id/title1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="患者信息"
|
||||
android:textColor="#ff202020"
|
||||
android:textSize="13sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/n1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="姓名:"
|
||||
android:textColor="#ff848484"
|
||||
android:textSize="11sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/v1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="--"
|
||||
android:textColor="#ff202020"
|
||||
android:textSize="11sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/n2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="性别:"
|
||||
android:textColor="#ff848484"
|
||||
android:textSize="11sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/v2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="--"
|
||||
android:textColor="#ff202020"
|
||||
android:textSize="11sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/n3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="年龄:"
|
||||
android:textColor="#ff848484"
|
||||
android:textSize="11sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/v3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="--"
|
||||
android:textColor="#ff202020"
|
||||
android:textSize="11sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/n4"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="电话:"
|
||||
android:textColor="#ff848484"
|
||||
android:textSize="11sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/v4"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="--"
|
||||
android:textColor="#ff202020"
|
||||
android:textSize="11sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/n5"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="地址:"
|
||||
android:textColor="#ff848484"
|
||||
android:textSize="11sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/v5"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="--"
|
||||
android:textColor="#ff202020"
|
||||
android:textSize="11sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="4"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="4dp"
|
||||
android:background="#BA7D45"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/title2"
|
||||
app:layout_constraintEnd_toEndOf="@+id/title2"
|
||||
app:layout_constraintStart_toStartOf="@+id/title2" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="就诊信息"
|
||||
android:textColor="#ff202020"
|
||||
android:textSize="13sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/n6"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="就诊卡号:"
|
||||
android:textColor="#ff848484"
|
||||
android:textSize="11sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/v6"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="--"
|
||||
android:textColor="#ff202020"
|
||||
android:textSize="11sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/n7"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="就诊科别:"
|
||||
android:textColor="#ff848484"
|
||||
android:textSize="11sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/v7"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="--"
|
||||
android:textColor="#ff202020"
|
||||
android:textSize="11sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/n8"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="诊断结果:"
|
||||
android:textColor="#ff848484"
|
||||
android:textSize="11sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/v8"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="--"
|
||||
android:textColor="#ff202020"
|
||||
android:textSize="11sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/n9"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="就诊日期:"
|
||||
android:textColor="#ff848484"
|
||||
android:textSize="11sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/v9"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="--"
|
||||
android:textColor="#ff202020"
|
||||
android:textSize="11sp" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="4"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="4dp"
|
||||
android:background="#BA7D45"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/title3"
|
||||
app:layout_constraintEnd_toEndOf="@+id/title3"
|
||||
app:layout_constraintStart_toStartOf="@+id/title3" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="医疗信息"
|
||||
android:textColor="#ff202020"
|
||||
android:textSize="13sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/n10"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="医疗类别:"
|
||||
android:textColor="#ff848484"
|
||||
android:textSize="11sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/v10"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="--"
|
||||
android:textColor="#ff202020"
|
||||
android:textSize="11sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/n11"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="医疗/医保卡:"
|
||||
android:textColor="#ff848484"
|
||||
android:textSize="11sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/v11"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="--"
|
||||
android:textColor="#ff202020"
|
||||
android:textSize="11sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="129dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@color/ic_launcher_background" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="15dp"
|
||||
android:layout_marginTop="20dp">
|
||||
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="4dp"
|
||||
android:background="#BA7D45"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/title4"
|
||||
app:layout_constraintEnd_toEndOf="@+id/title4"
|
||||
app:layout_constraintStart_toStartOf="@+id/title4" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title4"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="药品及使用说明"
|
||||
android:textColor="#ff202020"
|
||||
android:textSize="13sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<com.xuqm.base.view.MaxLimitRecyclerView
|
||||
android:id="@+id/list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:maxLength="6"
|
||||
android:paddingHorizontal="15dp"
|
||||
app:limit_maxHeight="350dp" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="15dp"
|
||||
android:layout_marginTop="20dp">
|
||||
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="4dp"
|
||||
android:background="#BA7D45"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/title5"
|
||||
app:layout_constraintEnd_toEndOf="@+id/title5"
|
||||
app:layout_constraintStart_toStartOf="@+id/title5" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title5"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="药品及使用说明"
|
||||
android:textColor="#ff202020"
|
||||
android:textSize="13sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:orientation="horizontal"
|
||||
android:paddingHorizontal="15dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/n12"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="药师:"
|
||||
android:textColor="#ff848484"
|
||||
android:textSize="11sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/v12"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="--"
|
||||
android:textColor="#ff202020"
|
||||
android:textSize="11sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/n13"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="审方:"
|
||||
android:textColor="#ff848484"
|
||||
android:textSize="11sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/v13"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="--"
|
||||
android:textColor="#ff202020"
|
||||
android:textSize="11sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/n14"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="医师:"
|
||||
android:textColor="#ff848484"
|
||||
android:textSize="11sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/v14"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="--"
|
||||
android:textColor="#ff202020"
|
||||
android:textSize="11sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/n15"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="调配:"
|
||||
android:textColor="#ff848484"
|
||||
android:textSize="11sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/v15"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="智慧药柜"
|
||||
android:textColor="#ff202020"
|
||||
android:textSize="11sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/n16"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="药品金额:"
|
||||
android:textColor="#ff848484"
|
||||
android:textSize="11sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/v16"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="--"
|
||||
android:textColor="#ff202020"
|
||||
android:textSize="11sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/n17"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="核对发药:"
|
||||
android:textColor="#ff848484"
|
||||
android:textSize="11sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/v17"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="--"
|
||||
android:textColor="#ff202020"
|
||||
android:textSize="11sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/btn"
|
||||
android:layout_width="170dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="45dp"
|
||||
android:layout_marginBottom="45dp"
|
||||
android:background="@drawable/bg_main_btn"
|
||||
android:gravity="center"
|
||||
android:text="确认发药"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
||||
@ -1,167 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout>
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:context=".ui.SettingActivity">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="40dp"
|
||||
android:gravity="center"
|
||||
android:text="开指定柜门"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="68dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@drawable/bg_button"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/a11"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:hint="柜号(1.2.3)"
|
||||
android:inputType="number" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/a12"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:hint="窗口号"
|
||||
android:inputType="number" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/a13"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_button_red"
|
||||
android:gravity="center"
|
||||
android:text="开门"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="18sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="40dp"
|
||||
android:gravity="center"
|
||||
android:text="开指定指定范围内柜门"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="68dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@drawable/bg_button"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/a21"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:hint="柜号(1.2.3)"
|
||||
android:inputType="number" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/a22"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:hint="开始窗口号"
|
||||
android:inputType="number" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/a23"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:hint="结束窗口号"
|
||||
android:inputType="number" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/a24"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_button_red"
|
||||
android:gravity="center"
|
||||
android:text="开门"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="18sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="40dp"
|
||||
android:gravity="center"
|
||||
android:text="一键开门"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="68dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@drawable/bg_button"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/a31"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_button_red"
|
||||
android:gravity="center"
|
||||
android:text="一号柜"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/a32"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginHorizontal="10dp"
|
||||
android:background="@drawable/bg_button_red"
|
||||
android:gravity="center"
|
||||
android:text="二号柜"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/a33"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_button_red"
|
||||
android:gravity="center"
|
||||
android:text="三号柜"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="18sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
@ -1,30 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".ui.TestActivity">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/edit_url"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="150dp"
|
||||
android:text="https://web.sdk.qcloud.com/trtc/webrtc/demo/quick-demo-vue3-ts/index.html#/"
|
||||
android:textSize="21sp"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="进入页面"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/edit_url" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
||||
@ -1,50 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout>
|
||||
|
||||
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#BA7D45"
|
||||
tools:context=".ui.WelcomeActivity">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:gravity="center"
|
||||
android:text="联创明医医院智慧药柜"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
android:id="@+id/baseRefreshLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginBottom="34dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/title">
|
||||
|
||||
<com.xuqm.base.view.EmptyView
|
||||
android:id="@+id/baseEmptyView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/baseRecyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:overScrollMode="never" />
|
||||
|
||||
</com.xuqm.base.view.EmptyView>
|
||||
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
||||
android:layout_height="match_parent">
|
||||
<TextView
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="welcome"/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
||||
@ -1,224 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/index"
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/bg_main_item_index"
|
||||
android:gravity="center"
|
||||
android:text="1"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/bg_main_item_content"
|
||||
android:orientation="horizontal"
|
||||
android:paddingHorizontal="6dp"
|
||||
android:gravity="center_vertical"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/index">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="25"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/n1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="药品名称"
|
||||
android:textColor="#ffacabab"
|
||||
android:textSize="10sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/v1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:layout_marginTop="6dp"
|
||||
android:lines="1"
|
||||
android:text="药品名称药品名称药品名称药品名称药品名称药品名称药品名称"
|
||||
android:textColor="#ff202020"
|
||||
android:textSize="12sp" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="18"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/n2"
|
||||
android:text="规格"
|
||||
android:textColor="#ffacabab"
|
||||
android:textSize="10sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:layout_marginTop="6dp"
|
||||
android:lines="1"
|
||||
android:text="0.5g*10粒"
|
||||
android:id="@+id/v2"
|
||||
android:textColor="#ff202020"
|
||||
android:textSize="12sp" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="9"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:id="@+id/n3"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="数量"
|
||||
android:textColor="#ffacabab"
|
||||
android:textSize="10sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:layout_marginTop="6dp"
|
||||
android:lines="1"
|
||||
android:id="@+id/v3"
|
||||
android:text="1盒"
|
||||
android:textColor="#ff202020"
|
||||
android:textSize="12sp" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="12"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/n4"
|
||||
android:text="使用方法"
|
||||
android:textColor="#ffacabab"
|
||||
android:textSize="10sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:layout_marginTop="6dp"
|
||||
android:lines="1"
|
||||
android:text="口服"
|
||||
android:id="@+id/v4"
|
||||
android:textColor="#ff202020"
|
||||
android:textSize="12sp" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="12"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:id="@+id/n5"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="用量"
|
||||
android:textColor="#ffacabab"
|
||||
android:textSize="10sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:layout_marginTop="6dp"
|
||||
android:lines="1"
|
||||
android:id="@+id/v5"
|
||||
android:text="6g"
|
||||
android:textColor="#ff202020"
|
||||
android:textSize="12sp" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="13"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="频次"
|
||||
android:id="@+id/n6"
|
||||
android:textColor="#ffacabab"
|
||||
android:textSize="10sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:layout_marginTop="6dp"
|
||||
android:lines="1"
|
||||
android:id="@+id/v6"
|
||||
android:text="每日1次"
|
||||
android:textColor="#ff202020"
|
||||
android:textSize="12sp" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="10"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/n7"
|
||||
android:text="使用周期"
|
||||
android:textColor="#ffacabab"
|
||||
android:textSize="10sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:layout_marginTop="6dp"
|
||||
android:lines="1"
|
||||
android:id="@+id/v7"
|
||||
android:text="2天"
|
||||
android:textColor="#ff202020"
|
||||
android:textSize="12sp" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
||||
@ -1,83 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="130dp"
|
||||
android:background="@drawable/bg_item_welcome">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/index"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="#BA7D45"
|
||||
android:paddingHorizontal="7.5dp"
|
||||
android:paddingVertical="3.5dp"
|
||||
android:text="01"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="13sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="活血止痛胶囊(10mg/盒)"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="13sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="@+id/index"
|
||||
app:layout_constraintTop_toBottomOf="@+id/index" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/hint"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="广东联合制药"
|
||||
android:textColor="#A4ADBA"
|
||||
android:textSize="10sp"
|
||||
app:layout_constraintStart_toStartOf="@+id/index"
|
||||
app:layout_constraintTop_toBottomOf="@+id/name" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/number"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:text="12.5"
|
||||
android:textColor="#FF4600"
|
||||
android:textStyle="bold"
|
||||
android:textSize="18sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@+id/index" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/unit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="元/盒"
|
||||
android:textColor="#FF4600"
|
||||
android:layout_marginBottom="3dp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/number"
|
||||
android:textSize="10sp"
|
||||
app:layout_constraintStart_toEndOf="@+id/number" />
|
||||
<TextView
|
||||
android:id="@+id/balance"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="剩余:100盒"
|
||||
android:textColor="#333333"
|
||||
android:layout_marginBottom="3dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/number"
|
||||
android:textSize="11sp"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
||||
二进制文件未显示。
|
之前 宽度: | 高度: | 大小: 7.3 KiB |
二进制文件未显示。
|
之前 宽度: | 高度: | 大小: 4.4 KiB |
二进制文件未显示。
|
之前 宽度: | 高度: | 大小: 79 KiB |
二进制文件未显示。
|
之前 宽度: | 高度: | 大小: 1.5 KiB |
二进制文件未显示。
|
之前 宽度: | 高度: | 大小: 136 KiB |
二进制文件未显示。
|
之前 宽度: | 高度: | 大小: 28 KiB |
@ -11,7 +11,7 @@ import java.io.IOException;
|
||||
* <pre></pre>
|
||||
* @文件名称: ImageHelp
|
||||
* @包 路 径: com.xuqm.base.common
|
||||
* @版权所有:北京数字医信责任有限公司 (C) 2021
|
||||
*
|
||||
*
|
||||
* @类描述:
|
||||
* @版本: V1.0
|
||||
|
||||
@ -4,7 +4,6 @@ package com.xuqm.base.webSocket;
|
||||
* <pre></pre>
|
||||
* @文件名称: ConnectStatus
|
||||
* @包 路 径: com.xuqm.base.webSocket
|
||||
* @版权所有:北京数字医信责任有限公司 (C) 2022
|
||||
*
|
||||
* @类描述:
|
||||
* @版本: V1.0
|
||||
|
||||
@ -4,7 +4,7 @@ package com.xuqm.base.webSocket;
|
||||
* <pre></pre>
|
||||
* @文件名称: WebSocketCallBack
|
||||
* @包 路 径: com.xuqm.base.webSocket
|
||||
* @版权所有:北京数字医信责任有限公司 (C) 2022
|
||||
*
|
||||
*
|
||||
* @类描述:
|
||||
* @版本: V1.0
|
||||
|
||||
@ -15,7 +15,7 @@ import okio.ByteString;
|
||||
* <pre></pre>
|
||||
* @文件名称: WebSocketHandler
|
||||
* @包 路 径: com.xuqm.base.webSocket
|
||||
* @版权所有:北京数字医信责任有限公司 (C) 2022
|
||||
*
|
||||
*
|
||||
* @类描述:
|
||||
* @版本: V1.0
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
ext {
|
||||
apps = [
|
||||
applicationName: '摆药机',
|
||||
applicationName: 'C大脑',
|
||||
applicationId : 'com.xuqm.hp.vending'
|
||||
]
|
||||
versions = [
|
||||
|
||||
正在加载...
在新工单中引用
屏蔽一个用户