初始化页面信息和mq连接提交
This commit is contained in:
parent
bd3de7896d
commit
3fa04e4581
|
|
@ -142,6 +142,9 @@ dependencies {
|
|||
implementation "androidx.room:room-runtime:2.3.0" // Room 库
|
||||
annotationProcessor "androidx.room:room-compiler:2.3.0" // 注解处理器(Java)
|
||||
|
||||
implementation 'org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.5'
|
||||
implementation 'org.eclipse.paho:org.eclipse.paho.android.service:1.1.1'
|
||||
|
||||
}
|
||||
//自动添加X-Library依赖
|
||||
apply from: 'x-library.gradle'
|
||||
|
|
|
|||
|
|
@ -192,6 +192,10 @@
|
|||
android:name="design_height_in_dp"
|
||||
android:value="800" />
|
||||
|
||||
<service android:name="org.eclipse.paho.android.service.MqttService" />
|
||||
|
||||
</application>
|
||||
|
||||
|
||||
|
||||
</manifest>
|
||||
|
|
@ -23,9 +23,10 @@ import android.provider.Settings;
|
|||
import android.telephony.TelephonyManager;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.widget.Button;
|
||||
import android.widget.ListView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.bonus.canteen.R;
|
||||
import com.bonus.canteen.adapter.initialization.IniListAdapter;
|
||||
|
|
@ -36,9 +37,18 @@ import com.bonus.canteen.adapter.menu.utils.WorkConfig;
|
|||
import com.bonus.canteen.core.BaseActivity;
|
||||
import com.bonus.canteen.databinding.InitializationMainBinding;
|
||||
import com.bonus.canteen.db.AppDatabase;
|
||||
import com.bonus.canteen.db.beans.base.DateListBean;
|
||||
import com.bonus.canteen.db.beans.base.IntervalBean;
|
||||
import com.bonus.canteen.db.beans.base.ProductBean;
|
||||
import com.bonus.canteen.db.entity.base.CookBookInfo;
|
||||
import com.bonus.canteen.db.entity.base.CookIntervalInfo;
|
||||
import com.bonus.canteen.db.entity.base.CustPhotoFulInfo;
|
||||
import com.bonus.canteen.db.entity.base.DeviceBaseInfo;
|
||||
import com.bonus.canteen.db.entity.base.MealTimeInfo;
|
||||
import com.bonus.canteen.db.entity.base.SecretKeyInfo;
|
||||
import com.bonus.canteen.db.entity.user.CustInfo;
|
||||
import com.bonus.canteen.utils.MemoryUtils;
|
||||
import com.bonus.canteen.utils.rabbitmq.RabbitMqMqttHelper;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.hjq.permissions.OnPermissionCallback;
|
||||
|
|
@ -78,11 +88,19 @@ public class InitializationActivity extends BaseActivity<InitializationMainBindi
|
|||
|
||||
private static final Integer UPDATE_ADAPTER = 1;
|
||||
|
||||
private RabbitMqMqttHelper mqttHelper;
|
||||
|
||||
private int personNum =0;
|
||||
private int personFaceNum =0;
|
||||
|
||||
|
||||
@Override
|
||||
protected InitializationMainBinding viewBindingInflate(LayoutInflater inflater) {
|
||||
return InitializationMainBinding.inflate(inflater);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
XUI.initTheme(this);
|
||||
|
|
@ -98,11 +116,267 @@ public class InitializationActivity extends BaseActivity<InitializationMainBindi
|
|||
//检查摄像头是否可用
|
||||
checkIfTheCameraIsAvailable();
|
||||
// //获取人员信息
|
||||
// iniListAdapter.addItem(new ListBean("开始更新人员信息...",0));
|
||||
// getPersonMessage();
|
||||
sendMessage("人员开始更新,请稍后", 0);
|
||||
getPersonMessage();
|
||||
getSecretKey();
|
||||
getMealTime();
|
||||
getDeviceBase();
|
||||
getCookBook();
|
||||
sendMessage("人脸信息开始更新,请稍后", 0);
|
||||
getCustPhoto();
|
||||
initMQ();
|
||||
}
|
||||
private void initMQ() {
|
||||
mqttHelper = new RabbitMqMqttHelper(this);
|
||||
mqttHelper.connect();
|
||||
TextView tv = findViewById(R.id.title_btn);
|
||||
tv.setOnClickListener(v -> {
|
||||
//模拟点击事件 后面需去掉
|
||||
mqttHelper.publish("test/topic", "Hello RabbitMQ MQTT");
|
||||
});
|
||||
}
|
||||
private void getCustPhoto(){
|
||||
ThreadPoolManager.getExecutor().execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
CustPhotoFulInfo bb = AppDatabase.getDatabase(InitializationActivity.this).custPhotoFulDao().getOneCustPhoto();
|
||||
|
||||
JSONObject json = new JSONObject();
|
||||
if(bb !=null){
|
||||
json.put("updateId",bb.getUpdateId());
|
||||
}else{
|
||||
json.put("updateId",1);
|
||||
}
|
||||
json.put("pagesize",100);
|
||||
String jsonString = json.toString();
|
||||
Log.i("getCustPhoto jsonString", jsonString);
|
||||
// 定义 JSON 的 MediaType
|
||||
MediaType JSON = MediaType.parse("application/json; charset=utf-8");
|
||||
// 创建 RequestBody
|
||||
RequestBody body = RequestBody.create(JSON, jsonString);
|
||||
String url = WorkConfig.getBaseUrl() + "/api/v4/device/common/person/feature-list";
|
||||
Request request = new Request.Builder().url(url)
|
||||
.addHeader("Authorization", OkHttpService.getToken())
|
||||
.addHeader("MERCHANT-ID", "378915229716713472")
|
||||
.addHeader("face-ver", "3288")
|
||||
.post(body).build();
|
||||
try {
|
||||
String result = service.httpPost(url, body, InitializationActivity.this,request);
|
||||
if(!"[]".equals(result)){
|
||||
Gson gson = new Gson();
|
||||
List<CustPhotoFulInfo> custPhotoFulInfoList = gson.fromJson(result, new TypeToken<List<CustPhotoFulInfo>>() {
|
||||
}.getType());
|
||||
if(custPhotoFulInfoList !=null && custPhotoFulInfoList.size()>0){
|
||||
AppDatabase.getDatabase(InitializationActivity.this).custPhotoFulDao().insertAll(custPhotoFulInfoList);
|
||||
personFaceNum = personFaceNum+custPhotoFulInfoList.size();
|
||||
getCustPhoto();
|
||||
}else{
|
||||
sendMessage("获取人脸信息成功!更新"+personFaceNum+"条数据", 0);
|
||||
}
|
||||
|
||||
}else {
|
||||
sendMessage("人脸信息更新成功!", 0);
|
||||
}
|
||||
Log.i("getCustPhoto result", jsonString);
|
||||
Log.i("getCustPhoto result", result);
|
||||
}catch (Exception e){
|
||||
Log.e("getCustPhoto",""+e.toString());
|
||||
sendMessage("获取人脸信息失败!", 1);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
private void getCookBook(){
|
||||
ThreadPoolManager.getExecutor().execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
JSONObject json = new JSONObject();
|
||||
String jsonString = json.toString();
|
||||
Log.i("getCookBook jsonString", jsonString);
|
||||
// 定义 JSON 的 MediaType
|
||||
MediaType JSON = MediaType.parse("application/json; charset=utf-8");
|
||||
// 创建 RequestBody
|
||||
RequestBody body = RequestBody.create(JSON, jsonString);
|
||||
String url = WorkConfig.getBaseUrl() + "/api/v4/device/common/menu/bind-info-config";
|
||||
|
||||
Request request = new Request.Builder().url(url)
|
||||
.addHeader("Authorization", OkHttpService.getToken())
|
||||
.addHeader("MERCHANT-ID", "378915229716713472")
|
||||
.addHeader("machine-sn", "2AD2435000620350")
|
||||
.post(body).build();
|
||||
try {
|
||||
String result = service.httpPost(url, body, InitializationActivity.this,request);
|
||||
Log.i("getCookBook result", jsonString);
|
||||
JSONObject firstJson = JSONObject.parseObject(result);
|
||||
if(firstJson.containsKey("dateList") && firstJson.containsKey("mealList")){
|
||||
AppDatabase.getDatabase(InitializationActivity.this).cookIntervalDao().deleteAll();
|
||||
AppDatabase.getDatabase(InitializationActivity.this).cookBookDao().deleteAll();
|
||||
String mealList = firstJson.getString("mealList");
|
||||
Gson gson = new Gson();
|
||||
List<CookBookInfo> cookBookInfoList = gson.fromJson(mealList, new TypeToken<List<CookBookInfo>>() {
|
||||
}.getType());
|
||||
for (CookBookInfo beab:cookBookInfoList){
|
||||
AppDatabase.getDatabase(InitializationActivity.this).cookBookDao().insert(beab);
|
||||
}
|
||||
String dateList = firstJson.getString("dateList");
|
||||
List<DateListBean> intervalList = gson.fromJson(dateList, new TypeToken<List<DateListBean>>() {
|
||||
}.getType());
|
||||
String recipeId = firstJson.getString("recipeId");
|
||||
String recipeType = firstJson.getString("recipeType");
|
||||
String uptime = firstJson.getString("uptime");
|
||||
for(DateListBean bean : intervalList){
|
||||
String applyDate = bean.getApplyDate();
|
||||
List<IntervalBean> intervalBeanList = bean.getIntervalList();
|
||||
for (IntervalBean intervalBean:intervalBeanList){
|
||||
CookIntervalInfo cookIntervalInfo = new CookIntervalInfo();
|
||||
String intervalId = intervalBean.getIntervalId();
|
||||
String intervalName = intervalBean.getIntervalName();
|
||||
String startTime = intervalBean.getStartTime();
|
||||
String endTime = intervalBean.getEndTime();
|
||||
List<ProductBean> productBeanList = intervalBean.getProductList();
|
||||
cookIntervalInfo.setRecipeId(recipeId);
|
||||
cookIntervalInfo.setRecipeType(recipeType);
|
||||
cookIntervalInfo.setUptime(uptime);
|
||||
cookIntervalInfo.setIntervalId(intervalId);
|
||||
cookIntervalInfo.setIntervalName(intervalName);
|
||||
cookIntervalInfo.setStartTime(startTime);
|
||||
cookIntervalInfo.setEndTime(endTime);
|
||||
cookIntervalInfo.setApplyDate(applyDate);
|
||||
if(productBeanList !=null && productBeanList.size()>0){
|
||||
for(ProductBean productBean:productBeanList){
|
||||
String detailId = productBean.getDetailId();
|
||||
String dishesId = productBean.getDishesId();
|
||||
String prefPrice = productBean.getPrefPrice();
|
||||
String salePrice = productBean.getSalePrice();
|
||||
cookIntervalInfo.setDetailId(detailId);
|
||||
cookIntervalInfo.setDishesId(dishesId);
|
||||
cookIntervalInfo.setPrefPrice(prefPrice);
|
||||
cookIntervalInfo.setSalePrice(salePrice);
|
||||
AppDatabase.getDatabase(InitializationActivity.this).cookIntervalDao().insert(cookIntervalInfo);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
sendMessage("获取菜谱信息成功!", 0);
|
||||
}else{
|
||||
sendMessage("获取菜谱信息失败!", 1);
|
||||
}
|
||||
|
||||
}catch (Exception e){
|
||||
Log.e("获取菜谱信息失败e",""+e.toString());
|
||||
sendMessage("获取菜谱信息失败!", 1);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void getDeviceBase(){
|
||||
ThreadPoolManager.getExecutor().execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
JSONObject json = new JSONObject();
|
||||
String jsonString = json.toString();
|
||||
Log.i("getSecretKey jsonString", jsonString);
|
||||
// 定义 JSON 的 MediaType
|
||||
MediaType JSON = MediaType.parse("application/json; charset=utf-8");
|
||||
// 创建 RequestBody
|
||||
RequestBody body = RequestBody.create(JSON, jsonString);
|
||||
String url = WorkConfig.getBaseUrl() + "/api/v4/device/common/base/config";
|
||||
|
||||
Request request = new Request.Builder().url(url)
|
||||
.addHeader("Authorization", OkHttpService.getToken())
|
||||
.addHeader("MERCHANT-ID", "378915229716713472")
|
||||
.addHeader("machine-sn", "2AD2435000620350")
|
||||
.post(body).build();
|
||||
try {
|
||||
String result = service.httpPost(url, body, InitializationActivity.this,request);
|
||||
Log.i("getDeviceBase result", jsonString);
|
||||
JSONObject firstJson = JSONObject.parseObject(result);
|
||||
if(firstJson.containsKey("deviceInfoVO")){
|
||||
AppDatabase.getDatabase(InitializationActivity.this).deviceBaseDao().deleteAll();
|
||||
DeviceBaseInfo deviceBaseInfo = new DeviceBaseInfo();
|
||||
String systemCardInfoStr = firstJson.getString("systemCardInfo");
|
||||
deviceBaseInfo.setSystemCardInfo(systemCardInfoStr);
|
||||
String deviceInfoVOStr = firstJson.getString("deviceInfoVO");
|
||||
JSONObject deviceInfoJson = JSONObject.parseObject(deviceInfoVOStr);
|
||||
String deviceMetadata = deviceInfoJson.getString("deviceMetadata");
|
||||
String canteenId = deviceInfoJson.getString("canteenId");
|
||||
String shopstallId = deviceInfoJson.getString("shopstallId");
|
||||
String canteenName = deviceInfoJson.getString("canteenName");
|
||||
String shopstallName = deviceInfoJson.getString("shopstallName");
|
||||
String recipeId = deviceInfoJson.getString("recipeId");
|
||||
String devicePwd = deviceInfoJson.getString("devicePwd");
|
||||
String deviceNum = deviceInfoJson.getString("deviceNum");
|
||||
String deviceName = deviceInfoJson.getString("deviceName");
|
||||
deviceBaseInfo.setDeviceMetadata(deviceMetadata);
|
||||
deviceBaseInfo.setCanteenId(canteenId);
|
||||
deviceBaseInfo.setShopstallId(shopstallId);
|
||||
deviceBaseInfo.setCanteenName(canteenName);
|
||||
deviceBaseInfo.setShopstallName(shopstallName);
|
||||
deviceBaseInfo.setRecipeId(recipeId);
|
||||
deviceBaseInfo.setDevicePwd(devicePwd);
|
||||
deviceBaseInfo.setDeviceNum(deviceNum);
|
||||
deviceBaseInfo.setDeviceName(deviceName);
|
||||
AppDatabase.getDatabase(InitializationActivity.this).deviceBaseDao().insert(deviceBaseInfo);
|
||||
sendMessage("获取设备基础信息、系统卡信息、设备自定义信息成功!", 0);
|
||||
}else{
|
||||
sendMessage("获取设备基础信息、系统卡信息、设备自定义信息失败!", 1);
|
||||
}
|
||||
|
||||
}catch (Exception e){
|
||||
sendMessage("获取设备基础信息、系统卡信息、设备自定义信息失败!", 1);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void getMealTime(){
|
||||
ThreadPoolManager.getExecutor().execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
JSONObject json = new JSONObject();
|
||||
String jsonString = json.toString();
|
||||
Log.i("getMealTime jsonString", jsonString);
|
||||
// 定义 JSON 的 MediaType
|
||||
MediaType JSON = MediaType.parse("application/json; charset=utf-8");
|
||||
// 创建 RequestBody
|
||||
RequestBody body = RequestBody.create(JSON, jsonString);
|
||||
String url = WorkConfig.getBaseUrl() + "/api/v4/device/common/base/interval-config";
|
||||
Request request = new Request.Builder().url(url)
|
||||
.addHeader("Authorization", OkHttpService.getToken())
|
||||
.addHeader("MERCHANT-ID", "378915229716713472")
|
||||
.addHeader("machine-sn", "2AD2435000620350")
|
||||
.post(body).build();
|
||||
try {
|
||||
String result = service.httpPost(url, body, InitializationActivity.this,request);
|
||||
Log.i("getMealTime result", jsonString);
|
||||
JSONObject firstJson = JSONObject.parseObject(result);
|
||||
if(firstJson.containsKey("basicsTimeIntervals")){
|
||||
String basicsTimeIntervalsStr = firstJson.getString("basicsTimeIntervals");
|
||||
AppDatabase.getDatabase(InitializationActivity.this).mealTimeDao().deleteAll();
|
||||
Gson gson = new Gson();
|
||||
List<MealTimeInfo> mealTimeList = gson.fromJson(basicsTimeIntervalsStr, new TypeToken<List<MealTimeInfo>>() {
|
||||
}.getType());
|
||||
for (MealTimeInfo bean : mealTimeList){
|
||||
AppDatabase.getDatabase(InitializationActivity.this).mealTimeDao().insert(bean);
|
||||
};
|
||||
sendMessage("获取餐次信息成功!", 0);
|
||||
}else{
|
||||
sendMessage("获取餐次信息失败!", 1);
|
||||
}
|
||||
|
||||
Log.i("getMealTime result", result);
|
||||
}catch (Exception e){
|
||||
sendMessage("获取餐次信息失败!", 1);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
//获取设备登录信息
|
||||
private void getDeviceLogin(String encryptionSn,SecretKeyInfo secretKeyInfo){
|
||||
|
||||
List<SecretKeyInfo> dbList = AppDatabase.getDatabase(InitializationActivity.this).SecretKeyDao().geSecretKey();
|
||||
|
|
@ -140,19 +414,19 @@ public class InitializationActivity extends BaseActivity<InitializationMainBindi
|
|||
SecretKeyInfo sk = AppDatabase.getDatabase(InitializationActivity.this).SecretKeyDao().geSecretKeyBySn(secretKeyInfo.getSn());
|
||||
if(sk !=null){
|
||||
AppDatabase.getDatabase(InitializationActivity.this).SecretKeyDao().update(secretKeyInfo);
|
||||
sendMessage("获取设备基础信息、系统卡信息、设备自定义信息成功", 0);
|
||||
sendMessage("获取设登录信息获取成功!", 0);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
sendMessage("获取设备基础信息、系统卡信息、设备自定义信息失败!", 1);
|
||||
sendMessage("获取设登录信息获取失败!", 1);
|
||||
}
|
||||
|
||||
}else{
|
||||
sendMessage("获取设备基础信息、系统卡信息、设备自定义信息失败!", 1);
|
||||
sendMessage("获取设登录信息获取失败!", 1);
|
||||
}
|
||||
Log.i("getDeviceLogin result", result);
|
||||
}catch (Exception e){
|
||||
sendMessage("获取设备基础信息、系统卡信息、设备自定义信息失败!", 1);
|
||||
sendMessage("获取设登录信息获取失败!", 1);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -215,11 +489,11 @@ public class InitializationActivity extends BaseActivity<InitializationMainBindi
|
|||
ThreadPoolManager.getExecutor().execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
List<CustInfo> dbList = AppDatabase.getDatabase(InitializationActivity.this).custInfoDao().getCustInfo();
|
||||
Log.i("getPersonMessage dbList", dbList.size() + "");
|
||||
CustInfo custBean= AppDatabase.getDatabase(InitializationActivity.this).custInfoDao().getOneCustInfo();
|
||||
JSONObject json = new JSONObject();
|
||||
if (dbList != null && dbList.size() > 0) {
|
||||
json.put("updateId", dbList.get(dbList.size() - 1).getUpdateId());
|
||||
if (custBean != null) {
|
||||
Log.i("getPersonMessage custInfo", custBean.toString() + "");
|
||||
json.put("updateId", custBean.getUpdateId());
|
||||
} else {
|
||||
json.put("updateId", 1);
|
||||
}
|
||||
|
|
@ -241,12 +515,13 @@ public class InitializationActivity extends BaseActivity<InitializationMainBindi
|
|||
CustInfo c = AppDatabase.getDatabase(InitializationActivity.this).custInfoDao().getCustInfoByCustId(custInfo.getCustId());
|
||||
if (c == null) {
|
||||
AppDatabase.getDatabase(InitializationActivity.this).custInfoDao().insert(custInfo);
|
||||
personNum = personNum+1;
|
||||
}
|
||||
}
|
||||
getPersonMessage();
|
||||
|
||||
} else {
|
||||
sendMessage("人员更新完成", 0);
|
||||
sendMessage("人员更新完成!更新"+personNum+"条数据", 0);
|
||||
}
|
||||
Log.i("getPersonMessage custInfoList", custInfoList.size() + "");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ public class OkHttpService {
|
|||
|
||||
private static final MediaType JSON = MediaType.parse("application/json; charset=utf-8");
|
||||
|
||||
private static String token = "eyJhbGciOiJIUzUxMiJ9.eyJ1c2VyX2lkIjozNzkyNTg1Mjk2NDQ1NDgwOTYsInVzZXJfa2V5IjoiZjhlNmQ1MTktMGFhNC00MjRhLWIyYjMtMjM3NmM0YmY3NTM2IiwidXNlcm5hbWUiOiJkZTU4ZjYzNjU3Y2RhOGVkYjZiZTg3NTExMGUyMDNmNCJ9.D76MEwBazAwbVQnHG_7_TTf--jtQkBOpvNLOZrsDtps7fJIce1_YdCYg1k6Cc-bw_eLV9G13QOKHWm1vXofPqA";
|
||||
private static String token = "eyJhbGciOiJIUzUxMiJ9.eyJ1c2VyX2lkIjozNzkyNTg1Mjk2NDQ1NDgwOTYsInVzZXJfa2V5IjoiMjE0Y2VhMjQtNTMyOS00ODU4LWJjNzctMzc3NzM3N2Y5YWVlIiwidXNlcm5hbWUiOiJkZTU4ZjYzNjU3Y2RhOGVkYjZiZTg3NTExMGUyMDNmNCJ9.edCpDQQY5Sdka28SxEW6rDtV8al9OI-qj2f6NNBjCNq5I1_eJUu4EUIi8WnjHCdH40sCkbKOUw4IvM8m0t_5XQ";
|
||||
|
||||
|
||||
public static String getToken(){
|
||||
|
|
|
|||
|
|
@ -2,24 +2,43 @@ package com.bonus.canteen.db;
|
|||
|
||||
import android.content.Context;
|
||||
|
||||
import com.bonus.canteen.db.dao.base.CookBookDao;
|
||||
import com.bonus.canteen.db.dao.base.CookIntervalDao;
|
||||
import com.bonus.canteen.db.dao.base.CustPhotoFulDao;
|
||||
import com.bonus.canteen.db.dao.base.DeviceBaseDao;
|
||||
import com.bonus.canteen.db.dao.base.MealTimeDao;
|
||||
import com.bonus.canteen.db.dao.base.SecretKeyDao;
|
||||
import com.bonus.canteen.db.dao.user.CustInfoDao;
|
||||
import com.bonus.canteen.db.entity.base.CookBookInfo;
|
||||
import com.bonus.canteen.db.entity.base.CookIntervalInfo;
|
||||
import com.bonus.canteen.db.entity.base.CustPhotoFulInfo;
|
||||
import com.bonus.canteen.db.entity.base.DeviceBaseInfo;
|
||||
import com.bonus.canteen.db.entity.base.MealTimeInfo;
|
||||
import com.bonus.canteen.db.entity.base.SecretKeyInfo;
|
||||
import com.bonus.canteen.db.entity.user.CustInfo;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.room.Database;
|
||||
import androidx.room.Room;
|
||||
import androidx.room.RoomDatabase;
|
||||
import androidx.room.migration.Migration;
|
||||
import androidx.sqlite.db.SupportSQLiteDatabase;
|
||||
|
||||
@Database(entities = {CustInfo.class, SecretKeyInfo.class}, version = 1)
|
||||
@Database(entities = {CustInfo.class, SecretKeyInfo.class, MealTimeInfo.class, DeviceBaseInfo.class, CookBookInfo.class,
|
||||
CookIntervalInfo.class, CustPhotoFulInfo.class}, version = 2)
|
||||
public abstract class AppDatabase extends RoomDatabase {
|
||||
|
||||
public abstract CustInfoDao custInfoDao(); // 提供 DAO 实例
|
||||
public abstract SecretKeyDao SecretKeyDao();
|
||||
|
||||
public abstract MealTimeDao mealTimeDao();
|
||||
|
||||
public abstract DeviceBaseDao deviceBaseDao();
|
||||
|
||||
public abstract CookBookDao cookBookDao();
|
||||
|
||||
public abstract CookIntervalDao cookIntervalDao();
|
||||
|
||||
public abstract CustPhotoFulDao custPhotoFulDao();
|
||||
|
||||
|
||||
private static volatile AppDatabase INSTANCE;
|
||||
|
||||
public static AppDatabase getDatabase(final Context context) {
|
||||
|
|
@ -28,6 +47,7 @@ public abstract class AppDatabase extends RoomDatabase {
|
|||
if (INSTANCE == null) {
|
||||
INSTANCE = Room.databaseBuilder(context.getApplicationContext(),
|
||||
AppDatabase.class, "app_database") // 数据库名称
|
||||
.fallbackToDestructiveMigration() // 删除旧表重建
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,34 @@
|
|||
package com.bonus.canteen.db.beans.base;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class DateListBean {
|
||||
|
||||
private String applyDate;
|
||||
private List<IntervalBean> intervalList;
|
||||
|
||||
|
||||
public String getApplyDate() {
|
||||
return applyDate;
|
||||
}
|
||||
|
||||
public void setApplyDate(String applyDate) {
|
||||
this.applyDate = applyDate;
|
||||
}
|
||||
|
||||
public List<IntervalBean> getIntervalList() {
|
||||
return intervalList;
|
||||
}
|
||||
|
||||
public void setIntervalList(List<IntervalBean> intervalList) {
|
||||
this.intervalList = intervalList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "DateListBean{" +
|
||||
"applyDate='" + applyDate + '\'' +
|
||||
", intervalList=" + intervalList +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
package com.bonus.canteen.db.beans.base;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class IntervalBean {
|
||||
|
||||
private String intervalId;
|
||||
|
||||
private String intervalName;
|
||||
|
||||
private String startTime;
|
||||
|
||||
private String endTime;
|
||||
|
||||
private List<ProductBean> productList;
|
||||
|
||||
|
||||
public String getIntervalId() {
|
||||
return intervalId;
|
||||
}
|
||||
|
||||
public void setIntervalId(String intervalId) {
|
||||
this.intervalId = intervalId;
|
||||
}
|
||||
|
||||
public String getIntervalName() {
|
||||
return intervalName;
|
||||
}
|
||||
|
||||
public void setIntervalName(String intervalName) {
|
||||
this.intervalName = intervalName;
|
||||
}
|
||||
|
||||
public String getStartTime() {
|
||||
return startTime;
|
||||
}
|
||||
|
||||
public void setStartTime(String startTime) {
|
||||
this.startTime = startTime;
|
||||
}
|
||||
|
||||
public String getEndTime() {
|
||||
return endTime;
|
||||
}
|
||||
|
||||
public void setEndTime(String endTime) {
|
||||
this.endTime = endTime;
|
||||
}
|
||||
|
||||
public List<ProductBean> getProductList() {
|
||||
return productList;
|
||||
}
|
||||
|
||||
public void setProductList(List<ProductBean> productList) {
|
||||
this.productList = productList;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "IntervalBean{" +
|
||||
"intervalId='" + intervalId + '\'' +
|
||||
", intervalName='" + intervalName + '\'' +
|
||||
", startTime='" + startTime + '\'' +
|
||||
", endTime='" + endTime + '\'' +
|
||||
", productList=" + productList +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
package com.bonus.canteen.db.beans.base;
|
||||
|
||||
public class ProductBean {
|
||||
|
||||
private String detailId;
|
||||
private String dishesId;
|
||||
|
||||
private String prefPrice;
|
||||
|
||||
private String salePrice;
|
||||
|
||||
public String getDetailId() {
|
||||
return detailId;
|
||||
}
|
||||
|
||||
public void setDetailId(String detailId) {
|
||||
this.detailId = detailId;
|
||||
}
|
||||
|
||||
public String getDishesId() {
|
||||
return dishesId;
|
||||
}
|
||||
|
||||
public void setDishesId(String dishesId) {
|
||||
this.dishesId = dishesId;
|
||||
}
|
||||
|
||||
public String getPrefPrice() {
|
||||
return prefPrice;
|
||||
}
|
||||
|
||||
public void setPrefPrice(String prefPrice) {
|
||||
this.prefPrice = prefPrice;
|
||||
}
|
||||
|
||||
public String getSalePrice() {
|
||||
return salePrice;
|
||||
}
|
||||
|
||||
public void setSalePrice(String salePrice) {
|
||||
this.salePrice = salePrice;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ProductBean{" +
|
||||
"detailId='" + detailId + '\'' +
|
||||
", dishesId='" + dishesId + '\'' +
|
||||
", prefPrice='" + prefPrice + '\'' +
|
||||
", salePrice='" + salePrice + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
package com.bonus.canteen.db.dao.base;
|
||||
|
||||
import com.bonus.canteen.db.entity.base.CookBookInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import androidx.room.Dao;
|
||||
import androidx.room.Delete;
|
||||
import androidx.room.Insert;
|
||||
import androidx.room.Query;
|
||||
import androidx.room.Update;
|
||||
|
||||
@Dao
|
||||
public interface CookBookDao {
|
||||
|
||||
@Query("select * from cook_book_info where dishesId=:dishesId")
|
||||
CookBookInfo getCookBookById(String dishesId);
|
||||
|
||||
@Query("select * from cook_book_info")
|
||||
List<CookBookInfo> getCookBook();
|
||||
|
||||
@Insert
|
||||
void insert(CookBookInfo device); // 插入数据
|
||||
|
||||
@Update
|
||||
void update(CookBookInfo device); // 更新数据
|
||||
|
||||
@Delete
|
||||
void delete(CookBookInfo device); // 删除数据
|
||||
|
||||
@Query("delete from cook_book_info ")
|
||||
void deleteAll(); // 删除数据
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package com.bonus.canteen.db.dao.base;
|
||||
|
||||
|
||||
import com.bonus.canteen.db.entity.base.CookIntervalInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import androidx.room.Dao;
|
||||
import androidx.room.Delete;
|
||||
import androidx.room.Insert;
|
||||
import androidx.room.Query;
|
||||
import androidx.room.Update;
|
||||
|
||||
@Dao
|
||||
public interface CookIntervalDao {
|
||||
@Query("select * from cook_interval_info where id =:id")
|
||||
CookIntervalInfo getCookBookById(int id);
|
||||
|
||||
@Query("select * from cook_interval_info")
|
||||
List<CookIntervalInfo> getCookInterval();
|
||||
|
||||
@Insert
|
||||
void insert(CookIntervalInfo intervalInfo); // 插入数据
|
||||
|
||||
@Update
|
||||
void update(CookIntervalInfo intervalInfo); // 更新数据
|
||||
|
||||
@Delete
|
||||
void delete(CookIntervalInfo intervalInfo); // 删除数据
|
||||
|
||||
@Query("delete from cook_interval_info ")
|
||||
void deleteAll(); // 删除数据
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
package com.bonus.canteen.db.dao.base;
|
||||
|
||||
|
||||
import com.bonus.canteen.db.entity.base.CustPhotoFulInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import androidx.room.Dao;
|
||||
import androidx.room.Delete;
|
||||
import androidx.room.Insert;
|
||||
import androidx.room.OnConflictStrategy;
|
||||
import androidx.room.Query;
|
||||
import androidx.room.Update;
|
||||
|
||||
@Dao
|
||||
public interface CustPhotoFulDao {
|
||||
|
||||
@Query("select * from cust_photo_ful where custId =:custId")
|
||||
CustPhotoFulInfo getCustPhotoById(int custId);
|
||||
|
||||
@Query("select * from cust_photo_ful")
|
||||
List<CustPhotoFulInfo> getCustPhoto();
|
||||
|
||||
@Query("select * from cust_photo_ful order by updateId desc limit 1")
|
||||
CustPhotoFulInfo getOneCustPhoto();
|
||||
|
||||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
||||
void insert(CustPhotoFulInfo custPhotoFulInfo); // 插入数据
|
||||
|
||||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
||||
void insertAll(List<CustPhotoFulInfo> custPhotoFulInfoList);
|
||||
|
||||
@Update
|
||||
void update(CustPhotoFulInfo custPhotoFulInfo); // 更新数据
|
||||
|
||||
@Delete
|
||||
void delete(CustPhotoFulInfo custPhotoFulInfo); // 删除数据
|
||||
|
||||
@Query("delete from cust_photo_ful ")
|
||||
void deleteAll(); // 删除数据
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
package com.bonus.canteen.db.dao.base;
|
||||
|
||||
|
||||
import com.bonus.canteen.db.entity.base.DeviceBaseInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import androidx.room.Dao;
|
||||
import androidx.room.Delete;
|
||||
import androidx.room.Insert;
|
||||
import androidx.room.Query;
|
||||
import androidx.room.Update;
|
||||
|
||||
@Dao
|
||||
public interface DeviceBaseDao {
|
||||
|
||||
@Query("select * from device_base where canteenId=:canteenId")
|
||||
DeviceBaseInfo getDeviceBaseById(String canteenId);
|
||||
|
||||
@Query("select * from device_base")
|
||||
List<DeviceBaseInfo> getDeviceBase();
|
||||
|
||||
@Insert
|
||||
void insert(DeviceBaseInfo device); // 插入数据
|
||||
|
||||
@Update
|
||||
void update(DeviceBaseInfo device); // 更新数据
|
||||
|
||||
@Delete
|
||||
void delete(DeviceBaseInfo device); // 删除数据
|
||||
|
||||
@Query("delete from device_base ")
|
||||
void deleteAll(); // 删除数据
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
package com.bonus.canteen.db.dao.base;
|
||||
|
||||
|
||||
import com.bonus.canteen.db.entity.base.MealTimeInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import androidx.room.Dao;
|
||||
import androidx.room.Delete;
|
||||
import androidx.room.Insert;
|
||||
import androidx.room.Query;
|
||||
import androidx.room.Update;
|
||||
|
||||
/**
|
||||
* @A
|
||||
*/
|
||||
@Dao
|
||||
public interface MealTimeDao {
|
||||
|
||||
@Query("select * from meal_time_info where intervalId=:intervalId")
|
||||
MealTimeInfo getMealTimeById(String intervalId);
|
||||
|
||||
@Query("select * from meal_time_info")
|
||||
List<MealTimeInfo> getMealTime();
|
||||
|
||||
@Insert
|
||||
void insert(MealTimeInfo meal); // 插入数据
|
||||
|
||||
@Update
|
||||
void update(MealTimeInfo meal); // 更新数据
|
||||
|
||||
@Delete
|
||||
void delete(MealTimeInfo meal); // 删除数据
|
||||
|
||||
@Query("delete from meal_time_info")
|
||||
void deleteAll(); // 删除数据
|
||||
|
||||
}
|
||||
|
|
@ -7,6 +7,7 @@ import java.util.List;
|
|||
import androidx.room.Dao;
|
||||
import androidx.room.Delete;
|
||||
import androidx.room.Insert;
|
||||
import androidx.room.OnConflictStrategy;
|
||||
import androidx.room.Query;
|
||||
import androidx.room.Update;
|
||||
|
||||
|
|
@ -16,10 +17,13 @@ public interface CustInfoDao {
|
|||
@Query("select * from cust_info where custId = :custId")
|
||||
CustInfo getCustInfoByCustId(String custId);
|
||||
|
||||
@Query("select * from cust_info")
|
||||
@Query("select * from cust_info ORDER BY updateId ")
|
||||
List<CustInfo> getCustInfo();
|
||||
|
||||
@Insert
|
||||
@Query("select * from cust_info ORDER BY updateId desc limit 1")
|
||||
CustInfo getOneCustInfo();
|
||||
|
||||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
||||
void insert(CustInfo user); // 插入数据
|
||||
|
||||
@Update
|
||||
|
|
|
|||
|
|
@ -0,0 +1,476 @@
|
|||
package com.bonus.canteen.db.entity.base;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import androidx.room.ColumnInfo;
|
||||
import androidx.room.Entity;
|
||||
import androidx.room.PrimaryKey;
|
||||
|
||||
@Entity(tableName = "cook_book_info")
|
||||
public class CookBookInfo {
|
||||
|
||||
@PrimaryKey
|
||||
@NotNull
|
||||
private String dishesId;
|
||||
|
||||
@ColumnInfo
|
||||
private String customId;
|
||||
|
||||
@ColumnInfo
|
||||
private String productName;
|
||||
|
||||
@ColumnInfo
|
||||
private String originalPrice;
|
||||
|
||||
@ColumnInfo
|
||||
private String salseMode;
|
||||
|
||||
@ColumnInfo
|
||||
private String weightDeviation;
|
||||
|
||||
@ColumnInfo
|
||||
private String weight;
|
||||
|
||||
@ColumnInfo
|
||||
private String typeId;
|
||||
|
||||
@ColumnInfo
|
||||
private String typeName;
|
||||
|
||||
@ColumnInfo
|
||||
private String pinyinInitials;
|
||||
|
||||
@ColumnInfo
|
||||
private String pinyinFull;
|
||||
|
||||
@ColumnInfo
|
||||
private String purine;
|
||||
|
||||
@ColumnInfo
|
||||
private String iodine;
|
||||
|
||||
@ColumnInfo
|
||||
private String initialScore;
|
||||
|
||||
@ColumnInfo
|
||||
private String calories;
|
||||
|
||||
@ColumnInfo
|
||||
private String protein;
|
||||
|
||||
@ColumnInfo
|
||||
private String fat;
|
||||
|
||||
@ColumnInfo
|
||||
private String carbohydrate;
|
||||
|
||||
@ColumnInfo
|
||||
private String dietaryFiber;
|
||||
|
||||
@ColumnInfo
|
||||
private String cholesterol;
|
||||
|
||||
@ColumnInfo
|
||||
private String calcium;
|
||||
|
||||
@ColumnInfo
|
||||
private String sodium;
|
||||
|
||||
@ColumnInfo
|
||||
private String caloriesNrv;
|
||||
|
||||
@ColumnInfo
|
||||
private String proteinNrv;
|
||||
|
||||
@ColumnInfo
|
||||
private String fatNrv;
|
||||
|
||||
@ColumnInfo
|
||||
private String carbohydrateNrv;
|
||||
|
||||
@ColumnInfo
|
||||
private String dietaryFiberNrv;
|
||||
|
||||
@ColumnInfo
|
||||
private String cholesterolNrv;
|
||||
|
||||
@ColumnInfo
|
||||
private String calciumNrv;
|
||||
|
||||
@ColumnInfo
|
||||
private String sodiumNrv;
|
||||
|
||||
@ColumnInfo
|
||||
private String foodImage;
|
||||
|
||||
@ColumnInfo
|
||||
private String intro;
|
||||
|
||||
@ColumnInfo
|
||||
private String labelList;
|
||||
|
||||
@ColumnInfo
|
||||
private String mainList;
|
||||
|
||||
@ColumnInfo
|
||||
private String auxList;
|
||||
|
||||
@ColumnInfo
|
||||
private String dosList;
|
||||
|
||||
@ColumnInfo
|
||||
private String monthlySales;
|
||||
|
||||
@ColumnInfo
|
||||
private String goodProbability;
|
||||
|
||||
|
||||
@NotNull
|
||||
public String getDishesId() {
|
||||
return dishesId;
|
||||
}
|
||||
|
||||
public void setDishesId(@NotNull String dishesId) {
|
||||
this.dishesId = dishesId;
|
||||
}
|
||||
|
||||
public String getCustomId() {
|
||||
return customId;
|
||||
}
|
||||
|
||||
public void setCustomId(String customId) {
|
||||
this.customId = customId;
|
||||
}
|
||||
|
||||
public String getProductName() {
|
||||
return productName;
|
||||
}
|
||||
|
||||
public void setProductName(String productName) {
|
||||
this.productName = productName;
|
||||
}
|
||||
|
||||
public String getOriginalPrice() {
|
||||
return originalPrice;
|
||||
}
|
||||
|
||||
public void setOriginalPrice(String originalPrice) {
|
||||
this.originalPrice = originalPrice;
|
||||
}
|
||||
|
||||
public String getSalseMode() {
|
||||
return salseMode;
|
||||
}
|
||||
|
||||
public void setSalseMode(String salseMode) {
|
||||
this.salseMode = salseMode;
|
||||
}
|
||||
|
||||
public String getWeightDeviation() {
|
||||
return weightDeviation;
|
||||
}
|
||||
|
||||
public void setWeightDeviation(String weightDeviation) {
|
||||
this.weightDeviation = weightDeviation;
|
||||
}
|
||||
|
||||
public String getWeight() {
|
||||
return weight;
|
||||
}
|
||||
|
||||
public void setWeight(String weight) {
|
||||
this.weight = weight;
|
||||
}
|
||||
|
||||
public String getTypeId() {
|
||||
return typeId;
|
||||
}
|
||||
|
||||
public void setTypeId(String typeId) {
|
||||
this.typeId = typeId;
|
||||
}
|
||||
|
||||
public String getTypeName() {
|
||||
return typeName;
|
||||
}
|
||||
|
||||
public void setTypeName(String typeName) {
|
||||
this.typeName = typeName;
|
||||
}
|
||||
|
||||
public String getPinyinInitials() {
|
||||
return pinyinInitials;
|
||||
}
|
||||
|
||||
public void setPinyinInitials(String pinyinInitials) {
|
||||
this.pinyinInitials = pinyinInitials;
|
||||
}
|
||||
|
||||
public String getPinyinFull() {
|
||||
return pinyinFull;
|
||||
}
|
||||
|
||||
public void setPinyinFull(String pinyinFull) {
|
||||
this.pinyinFull = pinyinFull;
|
||||
}
|
||||
|
||||
public String getPurine() {
|
||||
return purine;
|
||||
}
|
||||
|
||||
public void setPurine(String purine) {
|
||||
this.purine = purine;
|
||||
}
|
||||
|
||||
public String getIodine() {
|
||||
return iodine;
|
||||
}
|
||||
|
||||
public void setIodine(String iodine) {
|
||||
this.iodine = iodine;
|
||||
}
|
||||
|
||||
public String getInitialScore() {
|
||||
return initialScore;
|
||||
}
|
||||
|
||||
public void setInitialScore(String initialScore) {
|
||||
this.initialScore = initialScore;
|
||||
}
|
||||
|
||||
public String getCalories() {
|
||||
return calories;
|
||||
}
|
||||
|
||||
public void setCalories(String calories) {
|
||||
this.calories = calories;
|
||||
}
|
||||
|
||||
public String getProtein() {
|
||||
return protein;
|
||||
}
|
||||
|
||||
public void setProtein(String protein) {
|
||||
this.protein = protein;
|
||||
}
|
||||
|
||||
public String getFat() {
|
||||
return fat;
|
||||
}
|
||||
|
||||
public void setFat(String fat) {
|
||||
this.fat = fat;
|
||||
}
|
||||
|
||||
public String getCarbohydrate() {
|
||||
return carbohydrate;
|
||||
}
|
||||
|
||||
public void setCarbohydrate(String carbohydrate) {
|
||||
this.carbohydrate = carbohydrate;
|
||||
}
|
||||
|
||||
public String getDietaryFiber() {
|
||||
return dietaryFiber;
|
||||
}
|
||||
|
||||
public void setDietaryFiber(String dietaryFiber) {
|
||||
this.dietaryFiber = dietaryFiber;
|
||||
}
|
||||
|
||||
public String getCholesterol() {
|
||||
return cholesterol;
|
||||
}
|
||||
|
||||
public void setCholesterol(String cholesterol) {
|
||||
this.cholesterol = cholesterol;
|
||||
}
|
||||
|
||||
public String getCalcium() {
|
||||
return calcium;
|
||||
}
|
||||
|
||||
public void setCalcium(String calcium) {
|
||||
this.calcium = calcium;
|
||||
}
|
||||
|
||||
public String getSodium() {
|
||||
return sodium;
|
||||
}
|
||||
|
||||
public void setSodium(String sodium) {
|
||||
this.sodium = sodium;
|
||||
}
|
||||
|
||||
public String getCaloriesNrv() {
|
||||
return caloriesNrv;
|
||||
}
|
||||
|
||||
public void setCaloriesNrv(String caloriesNrv) {
|
||||
this.caloriesNrv = caloriesNrv;
|
||||
}
|
||||
|
||||
public String getProteinNrv() {
|
||||
return proteinNrv;
|
||||
}
|
||||
|
||||
public void setProteinNrv(String proteinNrv) {
|
||||
this.proteinNrv = proteinNrv;
|
||||
}
|
||||
|
||||
public String getFatNrv() {
|
||||
return fatNrv;
|
||||
}
|
||||
|
||||
public void setFatNrv(String fatNrv) {
|
||||
this.fatNrv = fatNrv;
|
||||
}
|
||||
|
||||
public String getCarbohydrateNrv() {
|
||||
return carbohydrateNrv;
|
||||
}
|
||||
|
||||
public void setCarbohydrateNrv(String carbohydrateNrv) {
|
||||
this.carbohydrateNrv = carbohydrateNrv;
|
||||
}
|
||||
|
||||
public String getDietaryFiberNrv() {
|
||||
return dietaryFiberNrv;
|
||||
}
|
||||
|
||||
public void setDietaryFiberNrv(String dietaryFiberNrv) {
|
||||
this.dietaryFiberNrv = dietaryFiberNrv;
|
||||
}
|
||||
|
||||
public String getCholesterolNrv() {
|
||||
return cholesterolNrv;
|
||||
}
|
||||
|
||||
public void setCholesterolNrv(String cholesterolNrv) {
|
||||
this.cholesterolNrv = cholesterolNrv;
|
||||
}
|
||||
|
||||
public String getCalciumNrv() {
|
||||
return calciumNrv;
|
||||
}
|
||||
|
||||
public void setCalciumNrv(String calciumNrv) {
|
||||
this.calciumNrv = calciumNrv;
|
||||
}
|
||||
|
||||
public String getSodiumNrv() {
|
||||
return sodiumNrv;
|
||||
}
|
||||
|
||||
public void setSodiumNrv(String sodiumNrv) {
|
||||
this.sodiumNrv = sodiumNrv;
|
||||
}
|
||||
|
||||
public String getFoodImage() {
|
||||
return foodImage;
|
||||
}
|
||||
|
||||
public void setFoodImage(String foodImage) {
|
||||
this.foodImage = foodImage;
|
||||
}
|
||||
|
||||
public String getIntro() {
|
||||
return intro;
|
||||
}
|
||||
|
||||
public void setIntro(String intro) {
|
||||
this.intro = intro;
|
||||
}
|
||||
|
||||
public String getLabelList() {
|
||||
return labelList;
|
||||
}
|
||||
|
||||
public void setLabelList(String labelList) {
|
||||
this.labelList = labelList;
|
||||
}
|
||||
|
||||
public String getMainList() {
|
||||
return mainList;
|
||||
}
|
||||
|
||||
public void setMainList(String mainList) {
|
||||
this.mainList = mainList;
|
||||
}
|
||||
|
||||
public String getAuxList() {
|
||||
return auxList;
|
||||
}
|
||||
|
||||
public void setAuxList(String auxList) {
|
||||
this.auxList = auxList;
|
||||
}
|
||||
|
||||
public String getDosList() {
|
||||
return dosList;
|
||||
}
|
||||
|
||||
public void setDosList(String dosList) {
|
||||
this.dosList = dosList;
|
||||
}
|
||||
|
||||
public String getMonthlySales() {
|
||||
return monthlySales;
|
||||
}
|
||||
|
||||
public void setMonthlySales(String monthlySales) {
|
||||
this.monthlySales = monthlySales;
|
||||
}
|
||||
|
||||
public String getGoodProbability() {
|
||||
return goodProbability;
|
||||
}
|
||||
|
||||
public void setGoodProbability(String goodProbability) {
|
||||
this.goodProbability = goodProbability;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CookBookInfo{" +
|
||||
"dishesId='" + dishesId + '\'' +
|
||||
", customId='" + customId + '\'' +
|
||||
", productName='" + productName + '\'' +
|
||||
", originalPrice='" + originalPrice + '\'' +
|
||||
", salseMode='" + salseMode + '\'' +
|
||||
", weightDeviation='" + weightDeviation + '\'' +
|
||||
", weight='" + weight + '\'' +
|
||||
", typeId='" + typeId + '\'' +
|
||||
", typeName='" + typeName + '\'' +
|
||||
", pinyinInitials='" + pinyinInitials + '\'' +
|
||||
", pinyinFull='" + pinyinFull + '\'' +
|
||||
", purine='" + purine + '\'' +
|
||||
", iodine='" + iodine + '\'' +
|
||||
", initialScore='" + initialScore + '\'' +
|
||||
", calories='" + calories + '\'' +
|
||||
", protein='" + protein + '\'' +
|
||||
", fat='" + fat + '\'' +
|
||||
", carbohydrate='" + carbohydrate + '\'' +
|
||||
", dietaryFiber='" + dietaryFiber + '\'' +
|
||||
", cholesterol='" + cholesterol + '\'' +
|
||||
", calcium='" + calcium + '\'' +
|
||||
", sodium='" + sodium + '\'' +
|
||||
", caloriesNrv='" + caloriesNrv + '\'' +
|
||||
", proteinNrv='" + proteinNrv + '\'' +
|
||||
", fatNrv='" + fatNrv + '\'' +
|
||||
", carbohydrateNrv='" + carbohydrateNrv + '\'' +
|
||||
", dietaryFiberNrv='" + dietaryFiberNrv + '\'' +
|
||||
", cholesterolNrv='" + cholesterolNrv + '\'' +
|
||||
", calciumNrv='" + calciumNrv + '\'' +
|
||||
", sodiumNrv='" + sodiumNrv + '\'' +
|
||||
", foodImage='" + foodImage + '\'' +
|
||||
", intro='" + intro + '\'' +
|
||||
", labelList='" + labelList + '\'' +
|
||||
", mainList='" + mainList + '\'' +
|
||||
", auxList='" + auxList + '\'' +
|
||||
", dosList='" + dosList + '\'' +
|
||||
", monthlySales='" + monthlySales + '\'' +
|
||||
", goodProbability='" + goodProbability + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,162 @@
|
|||
package com.bonus.canteen.db.entity.base;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import androidx.room.ColumnInfo;
|
||||
import androidx.room.Entity;
|
||||
import androidx.room.PrimaryKey;
|
||||
|
||||
@Entity(tableName = "cook_interval_info")
|
||||
public class CookIntervalInfo {
|
||||
|
||||
@PrimaryKey(autoGenerate = true)
|
||||
@NotNull
|
||||
private int id;
|
||||
@ColumnInfo
|
||||
private String recipeId;
|
||||
@ColumnInfo
|
||||
private String recipeType;
|
||||
@ColumnInfo
|
||||
private String uptime;
|
||||
@ColumnInfo
|
||||
private String applyDate;
|
||||
@ColumnInfo
|
||||
private String intervalId;
|
||||
@ColumnInfo
|
||||
private String intervalName;
|
||||
@ColumnInfo
|
||||
private String startTime;
|
||||
@ColumnInfo
|
||||
private String endTime;
|
||||
@ColumnInfo
|
||||
private String detailId;
|
||||
@ColumnInfo
|
||||
private String dishesId;
|
||||
@ColumnInfo
|
||||
private String prefPrice;
|
||||
@ColumnInfo
|
||||
private String salePrice;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getRecipeId() {
|
||||
return recipeId;
|
||||
}
|
||||
|
||||
public void setRecipeId(String recipeId) {
|
||||
this.recipeId = recipeId;
|
||||
}
|
||||
|
||||
public String getRecipeType() {
|
||||
return recipeType;
|
||||
}
|
||||
|
||||
public void setRecipeType(String recipeType) {
|
||||
this.recipeType = recipeType;
|
||||
}
|
||||
|
||||
public String getApplyDate() {
|
||||
return applyDate;
|
||||
}
|
||||
|
||||
public void setApplyDate(String applyDate) {
|
||||
this.applyDate = applyDate;
|
||||
}
|
||||
|
||||
public String getIntervalId() {
|
||||
return intervalId;
|
||||
}
|
||||
|
||||
public void setIntervalId(String intervalId) {
|
||||
this.intervalId = intervalId;
|
||||
}
|
||||
|
||||
public String getIntervalName() {
|
||||
return intervalName;
|
||||
}
|
||||
|
||||
public void setIntervalName(String intervalName) {
|
||||
this.intervalName = intervalName;
|
||||
}
|
||||
|
||||
public String getStartTime() {
|
||||
return startTime;
|
||||
}
|
||||
|
||||
public void setStartTime(String startTime) {
|
||||
this.startTime = startTime;
|
||||
}
|
||||
|
||||
public String getEndTime() {
|
||||
return endTime;
|
||||
}
|
||||
|
||||
public void setEndTime(String endTime) {
|
||||
this.endTime = endTime;
|
||||
}
|
||||
|
||||
public String getDetailId() {
|
||||
return detailId;
|
||||
}
|
||||
|
||||
public void setDetailId(String detailId) {
|
||||
this.detailId = detailId;
|
||||
}
|
||||
|
||||
public String getDishesId() {
|
||||
return dishesId;
|
||||
}
|
||||
|
||||
public void setDishesId(String dishesId) {
|
||||
this.dishesId = dishesId;
|
||||
}
|
||||
|
||||
public String getPrefPrice() {
|
||||
return prefPrice;
|
||||
}
|
||||
|
||||
public void setPrefPrice(String prefPrice) {
|
||||
this.prefPrice = prefPrice;
|
||||
}
|
||||
|
||||
public String getSalePrice() {
|
||||
return salePrice;
|
||||
}
|
||||
|
||||
public void setSalePrice(String salePrice) {
|
||||
this.salePrice = salePrice;
|
||||
}
|
||||
|
||||
public String getUptime() {
|
||||
return uptime;
|
||||
}
|
||||
|
||||
public void setUptime(String uptime) {
|
||||
this.uptime = uptime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CookIntervalInfo{" +
|
||||
"id=" + id +
|
||||
", recipeId='" + recipeId + '\'' +
|
||||
", recipeType='" + recipeType + '\'' +
|
||||
", uptime='" + uptime + '\'' +
|
||||
", applyDate='" + applyDate + '\'' +
|
||||
", intervalId='" + intervalId + '\'' +
|
||||
", intervalName='" + intervalName + '\'' +
|
||||
", startTime='" + startTime + '\'' +
|
||||
", endTime='" + endTime + '\'' +
|
||||
", detailId='" + detailId + '\'' +
|
||||
", dishesId='" + dishesId + '\'' +
|
||||
", prefPrice='" + prefPrice + '\'' +
|
||||
", salePrice='" + salePrice + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
package com.bonus.canteen.db.entity.base;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import androidx.room.ColumnInfo;
|
||||
import androidx.room.Entity;
|
||||
import androidx.room.PrimaryKey;
|
||||
|
||||
@Entity(tableName = "cust_photo_ful")
|
||||
public class CustPhotoFulInfo {
|
||||
|
||||
@PrimaryKey
|
||||
@NotNull
|
||||
private String custId;
|
||||
@ColumnInfo
|
||||
private String updateId;
|
||||
|
||||
@ColumnInfo
|
||||
private String features;
|
||||
|
||||
@ColumnInfo
|
||||
private String custPhotoUrl;
|
||||
|
||||
@NotNull
|
||||
public String getCustId() {
|
||||
return custId;
|
||||
}
|
||||
|
||||
public void setCustId(@NotNull String custId) {
|
||||
this.custId = custId;
|
||||
}
|
||||
|
||||
public String getUpdateId() {
|
||||
return updateId;
|
||||
}
|
||||
|
||||
public void setUpdateId(String updateId) {
|
||||
this.updateId = updateId;
|
||||
}
|
||||
|
||||
public String getFeatures() {
|
||||
return features;
|
||||
}
|
||||
|
||||
public void setFeatures(String features) {
|
||||
this.features = features;
|
||||
}
|
||||
|
||||
public String getCustPhotoUrl() {
|
||||
return custPhotoUrl;
|
||||
}
|
||||
|
||||
public void setCustPhotoUrl(String custPhotoUrl) {
|
||||
this.custPhotoUrl = custPhotoUrl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CustPhotoFulInfo{" +
|
||||
"custId='" + custId + '\'' +
|
||||
", updateId='" + updateId + '\'' +
|
||||
", features='" + features + '\'' +
|
||||
", custPhotoUrl='" + custPhotoUrl + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,142 @@
|
|||
package com.bonus.canteen.db.entity.base;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import androidx.room.ColumnInfo;
|
||||
import androidx.room.Entity;
|
||||
import androidx.room.PrimaryKey;
|
||||
|
||||
@Entity(tableName = "device_base")
|
||||
public class DeviceBaseInfo {
|
||||
@ColumnInfo
|
||||
private String systemCardInfo;
|
||||
@ColumnInfo
|
||||
private String deviceMetadata;
|
||||
@ColumnInfo
|
||||
private String recipeList;
|
||||
|
||||
@PrimaryKey
|
||||
@NotNull
|
||||
private String canteenId;
|
||||
@ColumnInfo
|
||||
private String shopstallId;
|
||||
@ColumnInfo
|
||||
private String canteenName;
|
||||
@ColumnInfo
|
||||
private String shopstallName;
|
||||
@ColumnInfo
|
||||
private String recipeId;
|
||||
@ColumnInfo
|
||||
private String devicePwd;
|
||||
@ColumnInfo
|
||||
private String deviceNum;
|
||||
@ColumnInfo
|
||||
private String deviceName;
|
||||
|
||||
public String getSystemCardInfo() {
|
||||
return systemCardInfo;
|
||||
}
|
||||
|
||||
public void setSystemCardInfo(String systemCardInfo) {
|
||||
this.systemCardInfo = systemCardInfo;
|
||||
}
|
||||
|
||||
public String getDeviceMetadata() {
|
||||
return deviceMetadata;
|
||||
}
|
||||
|
||||
public void setDeviceMetadata(String deviceMetadata) {
|
||||
this.deviceMetadata = deviceMetadata;
|
||||
}
|
||||
|
||||
public String getRecipeList() {
|
||||
return recipeList;
|
||||
}
|
||||
|
||||
public void setRecipeList(String recipeList) {
|
||||
this.recipeList = recipeList;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String getCanteenId() {
|
||||
return canteenId;
|
||||
}
|
||||
|
||||
public void setCanteenId(@NotNull String canteenId) {
|
||||
this.canteenId = canteenId;
|
||||
}
|
||||
|
||||
public String getShopstallId() {
|
||||
return shopstallId;
|
||||
}
|
||||
|
||||
public void setShopstallId(String shopstallId) {
|
||||
this.shopstallId = shopstallId;
|
||||
}
|
||||
|
||||
public String getCanteenName() {
|
||||
return canteenName;
|
||||
}
|
||||
|
||||
public void setCanteenName(String canteenName) {
|
||||
this.canteenName = canteenName;
|
||||
}
|
||||
|
||||
public String getShopstallName() {
|
||||
return shopstallName;
|
||||
}
|
||||
|
||||
public void setShopstallName(String shopstallName) {
|
||||
this.shopstallName = shopstallName;
|
||||
}
|
||||
|
||||
public String getRecipeId() {
|
||||
return recipeId;
|
||||
}
|
||||
|
||||
public void setRecipeId(String recipeId) {
|
||||
this.recipeId = recipeId;
|
||||
}
|
||||
|
||||
public String getDevicePwd() {
|
||||
return devicePwd;
|
||||
}
|
||||
|
||||
public void setDevicePwd(String devicePwd) {
|
||||
this.devicePwd = devicePwd;
|
||||
}
|
||||
|
||||
public String getDeviceNum() {
|
||||
return deviceNum;
|
||||
}
|
||||
|
||||
public void setDeviceNum(String deviceNum) {
|
||||
this.deviceNum = deviceNum;
|
||||
}
|
||||
|
||||
public String getDeviceName() {
|
||||
return deviceName;
|
||||
}
|
||||
|
||||
public void setDeviceName(String deviceName) {
|
||||
this.deviceName = deviceName;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "DeviceBaseInfo{" +
|
||||
"systemCardInfo='" + systemCardInfo + '\'' +
|
||||
", deviceMetadata='" + deviceMetadata + '\'' +
|
||||
", recipeList='" + recipeList + '\'' +
|
||||
", canteenId='" + canteenId + '\'' +
|
||||
", shopstallId='" + shopstallId + '\'' +
|
||||
", canteenName='" + canteenName + '\'' +
|
||||
", shopstallName='" + shopstallName + '\'' +
|
||||
", recipeId='" + recipeId + '\'' +
|
||||
", devicePwd='" + devicePwd + '\'' +
|
||||
", deviceNum='" + deviceNum + '\'' +
|
||||
", deviceName='" + deviceName + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
package com.bonus.canteen.db.entity.base;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import androidx.room.ColumnInfo;
|
||||
import androidx.room.Entity;
|
||||
import androidx.room.PrimaryKey;
|
||||
|
||||
/**餐次信息
|
||||
*
|
||||
*/
|
||||
@Entity(tableName = "meal_time_info")
|
||||
public class MealTimeInfo {
|
||||
|
||||
@PrimaryKey
|
||||
@NotNull
|
||||
private String intervalId;
|
||||
|
||||
@ColumnInfo
|
||||
private String intervalName;
|
||||
|
||||
@ColumnInfo
|
||||
private String startTime;
|
||||
|
||||
@ColumnInfo
|
||||
private String endTime;
|
||||
|
||||
@ColumnInfo
|
||||
private String ifUse;
|
||||
|
||||
|
||||
@NotNull
|
||||
public String getIntervalId() {
|
||||
return intervalId;
|
||||
}
|
||||
|
||||
public void setIntervalId(@NotNull String intervalId) {
|
||||
this.intervalId = intervalId;
|
||||
}
|
||||
|
||||
public String getIntervalName() {
|
||||
return intervalName;
|
||||
}
|
||||
|
||||
public void setIntervalName(String intervalName) {
|
||||
this.intervalName = intervalName;
|
||||
}
|
||||
|
||||
public String getStartTime() {
|
||||
return startTime;
|
||||
}
|
||||
|
||||
public void setStartTime(String startTime) {
|
||||
this.startTime = startTime;
|
||||
}
|
||||
|
||||
public String getEndTime() {
|
||||
return endTime;
|
||||
}
|
||||
|
||||
public void setEndTime(String endTime) {
|
||||
this.endTime = endTime;
|
||||
}
|
||||
|
||||
public String getIfUse() {
|
||||
return ifUse;
|
||||
}
|
||||
|
||||
public void setIfUse(String ifUse) {
|
||||
this.ifUse = ifUse;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MealTimeInfo{" +
|
||||
"intervalId='" + intervalId + '\'' +
|
||||
", intervalName='" + intervalName + '\'' +
|
||||
", startTime='" + startTime + '\'' +
|
||||
", endTime='" + endTime + '\'' +
|
||||
", ifUse='" + ifUse + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,134 @@
|
|||
package com.bonus.canteen.utils.rabbitmq;
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
import org.eclipse.paho.android.service.MqttAndroidClient;
|
||||
import org.eclipse.paho.android.service.MqttTraceHandler;
|
||||
import org.eclipse.paho.client.mqttv3.*;
|
||||
|
||||
public class RabbitMqMqttHelper {
|
||||
private static final String TAG = "RabbitMqMqttHelper";
|
||||
|
||||
private MqttAndroidClient mqttAndroidClient;
|
||||
// RabbitMQ 默认MQTT端口是1883,带SSL是8883
|
||||
private String serverUri = "tcp://192.168.0.244:1883";
|
||||
private String clientId = "AndroidClient_" + System.currentTimeMillis();
|
||||
private String subscriptionTopic = "test/topic";
|
||||
|
||||
// RabbitMQ 认证使用AMQP的用户名密码
|
||||
private String username = "admin"; // RabbitMQ管理用户
|
||||
private String password = "Bonus@admin123!";
|
||||
|
||||
public RabbitMqMqttHelper(Context context) {
|
||||
mqttAndroidClient = new MqttAndroidClient(context, serverUri, clientId);
|
||||
}
|
||||
|
||||
public void connect() {
|
||||
MqttConnectOptions options = new MqttConnectOptions();
|
||||
options.setAutomaticReconnect(true);
|
||||
options.setCleanSession(true);
|
||||
|
||||
// RabbitMQ 特定设置
|
||||
options.setConnectionTimeout(30);
|
||||
options.setKeepAliveInterval(60);
|
||||
options.setMqttVersion(MqttConnectOptions.MQTT_VERSION_3_1_1);
|
||||
|
||||
// 使用RabbitMQ的虚拟主机(如果需要)
|
||||
// options.setWill("/vhost1/will", "disconnected".getBytes(), 2, true);
|
||||
|
||||
if (username != null && password != null) {
|
||||
options.setUserName(username);
|
||||
options.setPassword(password.toCharArray());
|
||||
}
|
||||
|
||||
try {
|
||||
mqttAndroidClient.connect(options, null, new IMqttActionListener() {
|
||||
@Override
|
||||
public void onSuccess(IMqttToken asyncActionToken) {
|
||||
Log.d(TAG, "Connected to RabbitMQ MQTT");
|
||||
subscribeToTopic();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(IMqttToken asyncActionToken, Throwable exception) {
|
||||
Log.e(TAG, "Connection failed: " + exception.getMessage());
|
||||
}
|
||||
});
|
||||
|
||||
mqttAndroidClient.setCallback(new MqttCallback() {
|
||||
@Override
|
||||
public void connectionLost(Throwable cause) {
|
||||
Log.e(TAG, "Connection lost: " + cause.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void messageArrived(String topic, MqttMessage message) {
|
||||
String payload = new String(message.getPayload());
|
||||
Log.d(TAG, "Received: " + topic + " => " + payload);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deliveryComplete(IMqttDeliveryToken token) {
|
||||
Log.d(TAG, "Message delivered");
|
||||
}
|
||||
});
|
||||
mqttAndroidClient.setTraceCallback(new MqttTraceHandler() {
|
||||
@Override
|
||||
public void traceDebug(String source, String message) {
|
||||
Log.d("MQTT_TRACE", source + ": " + message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void traceError(String source, String message) {
|
||||
Log.e("MQTT_TRACE", source + ": " + message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void traceException(String source, String message, Exception e) {
|
||||
Log.e("MQTT_TRACE", source + ": " + message, e);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
} catch (MqttException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void subscribeToTopic() {
|
||||
try {
|
||||
mqttAndroidClient.subscribe(subscriptionTopic, 1, null, new IMqttActionListener() {
|
||||
@Override
|
||||
public void onSuccess(IMqttToken asyncActionToken) {
|
||||
Log.d(TAG, "Subscribed to " + subscriptionTopic);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(IMqttToken asyncActionToken, Throwable exception) {
|
||||
Log.e(TAG, "Subscribe failed: " + exception.getMessage());
|
||||
}
|
||||
});
|
||||
} catch (MqttException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void publish(String topic, String message) {
|
||||
try {
|
||||
MqttMessage mqttMessage = new MqttMessage(message.getBytes());
|
||||
mqttMessage.setQos(1);
|
||||
mqttAndroidClient.publish(topic, mqttMessage);
|
||||
Log.d(TAG, "Message published to " + topic);
|
||||
} catch (MqttException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void disconnect() {
|
||||
try {
|
||||
mqttAndroidClient.disconnect();
|
||||
Log.d(TAG, "Disconnected from RabbitMQ");
|
||||
} catch (MqttException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -21,6 +21,7 @@
|
|||
android:gravity="center">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title_btn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:textSize="@dimen/config_margin_30dp"
|
||||
|
|
|
|||
Loading…
Reference in New Issue