Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
supplier
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王宇航
supplier
Commits
4522d151
Commit
4522d151
authored
Mar 04, 2020
by
王宇航
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
3-04
parent
35b7599f
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
145 additions
and
118 deletions
+145
-118
main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/activity/NewMainActivity.java
+38
-56
main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/adapter/MainOrderingAdapter.java
+6
-6
print-module/build.gradle
+0
-1
print-module/src/main/java/com/joe/print/mvp/ui/activity/PrintActivity.java
+1
-13
public-base/build.gradle
+4
-4
public-base/libs/nexgon5lib.jar
+0
-0
public-base/src/main/java/com/gingersoft/gsa/cloud/base/application/GsaCloudApplication.java
+23
-2
public-base/src/main/java/com/gingersoft/gsa/cloud/database/bean/Function.java
+24
-3
public-base/src/main/java/com/gingersoft/gsa/cloud/database/greendao/FunctionDao.java
+42
-30
user-login/src/main/AndroidManifest.xml
+6
-3
user-login/src/main/java/com/gingersoft/gsa/cloud/user/login/mvp/ui/activity/SwitchServerActivity.java
+1
-0
No files found.
main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/activity/NewMainActivity.java
View file @
4522d151
...
@@ -4,6 +4,7 @@ import android.content.Intent;
...
@@ -4,6 +4,7 @@ import android.content.Intent;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.os.Message
;
import
android.os.Message
;
import
android.text.TextUtils
;
import
android.text.TextUtils
;
import
android.util.SparseArray
;
import
android.view.KeyEvent
;
import
android.view.KeyEvent
;
import
android.view.View
;
import
android.view.View
;
import
android.widget.LinearLayout
;
import
android.widget.LinearLayout
;
...
@@ -20,7 +21,6 @@ import com.gingersoft.gsa.cloud.main.R;
...
@@ -20,7 +21,6 @@ import com.gingersoft.gsa.cloud.main.R;
import
com.gingersoft.gsa.cloud.main.R2
;
import
com.gingersoft.gsa.cloud.main.R2
;
import
com.gingersoft.gsa.cloud.main.di.component.DaggerNewMainComponent
;
import
com.gingersoft.gsa.cloud.main.di.component.DaggerNewMainComponent
;
import
com.gingersoft.gsa.cloud.main.mvp.contract.NewMainContract
;
import
com.gingersoft.gsa.cloud.main.mvp.contract.NewMainContract
;
import
com.gingersoft.gsa.cloud.main.mvp.model.bean.SectionItem
;
import
com.gingersoft.gsa.cloud.main.mvp.presenter.NewMainPresenter
;
import
com.gingersoft.gsa.cloud.main.mvp.presenter.NewMainPresenter
;
import
com.gingersoft.gsa.cloud.main.mvp.ui.adapter.MainOrderingAdapter
;
import
com.gingersoft.gsa.cloud.main.mvp.ui.adapter.MainOrderingAdapter
;
import
com.gingersoft.gsa.cloud.main.mvp.ui.fragment.MainTopFragment
;
import
com.gingersoft.gsa.cloud.main.mvp.ui.fragment.MainTopFragment
;
...
@@ -140,85 +140,67 @@ public class NewMainActivity extends BaseActivity<NewMainPresenter> implements N
...
@@ -140,85 +140,67 @@ public class NewMainActivity extends BaseActivity<NewMainPresenter> implements N
setTitleInfo
();
setTitleInfo
();
}
}
public
void
onFinishRefresh
(){
public
void
onFinishRefresh
()
{
refresh
.
finishRefresh
();
refresh
.
finishRefresh
();
}
}
private
void
initFuncationData
()
{
private
void
initFuncationData
()
{
//拿到功能列表數據
FunctionDaoUtils
functionDao
=
new
FunctionDaoUtils
(
mContext
);
FunctionDaoUtils
functionDao
=
new
FunctionDaoUtils
(
mContext
);
List
<
Function
>
functions
=
functionDao
.
queryAllFunction
();
List
<
Function
>
functions
=
functionDao
.
queryAllFunction
();
if
(
functions
==
null
)
{
if
(
functions
==
null
)
{
return
;
return
;
}
}
List
<
SectionItem
>
data
=
new
ArrayList
<>();
//將功能列表數據分組
data
.
add
(
new
SectionItem
(
R
.
drawable
.
ic_dining_table_mode
,
"餐檯模式"
));
SparseArray
<
String
>
parents
=
new
SparseArray
<>();
data
.
add
(
new
SectionItem
(
R
.
drawable
.
ic_delivery_mode
,
"外送模式"
));
SparseArray
<
List
<
Function
>>
funMap
=
new
SparseArray
<>();
data
.
add
(
new
SectionItem
(
R
.
drawable
.
ic_outsourcing_model
,
"外賣模式"
));
for
(
Function
function
:
functions
)
{
data
.
add
(
new
SectionItem
(
R
.
drawable
.
ic_pre_order_mode
,
"預點餐模式"
));
if
(
function
.
getParentId
()
==
0
)
{
//父模塊
// int lastIndex;
parents
.
put
(
function
.
getId
().
intValue
(),
function
.
getResName
());
// if (functions.size() >= 4) {
}
else
{
// lastIndex = 4;
if
(
funMap
.
get
(
function
.
getParentId
())
==
null
)
{
// } else {
List
<
Function
>
functionList
=
new
ArrayList
<>();
// lastIndex = functions.size();
functionList
.
add
(
function
);
// }
funMap
.
put
(
function
.
getParentId
(),
functionList
);
MainOrderingAdapter
adapter
=
new
MainOrderingAdapter
(
R
.
layout
.
main_home_funcation_item
,
data
);
}
else
{
funMap
.
get
(
function
.
getParentId
()).
add
(
function
);
}
}
}
initAdapter
(
parents
,
funMap
,
0
,
R
.
layout
.
main_home_funcation_item
,
rvOrdering
,
4
);
initAdapter
(
parents
,
funMap
,
1
,
R
.
layout
.
main_home_management_funcation_item
,
rvManagement
,
5
);
initAdapter
(
parents
,
funMap
,
2
,
R
.
layout
.
main_home_management_funcation_item
,
rvStaffManagement
,
4
);
}
rvOrdering
.
setLayoutManager
(
new
GridLayoutManager
(
mContext
,
4
)
{
private
void
initAdapter
(
SparseArray
<
String
>
parents
,
SparseArray
<
List
<
Function
>>
funMap
,
int
i
,
int
p
,
RecyclerView
rvOrdering
,
int
i2
)
{
if
(
funMap
.
size
()
>
i
&&
parents
.
size
()
>
i
)
{
List
<
Function
>
mOrderingMeals
=
funMap
.
get
(
parents
.
keyAt
(
i
));
MainOrderingAdapter
adapter
=
new
MainOrderingAdapter
(
p
,
mOrderingMeals
);
rvOrdering
.
setLayoutManager
(
new
GridLayoutManager
(
mContext
,
i2
)
{
@Override
@Override
public
boolean
canScrollVertically
()
{
public
boolean
canScrollVertically
()
{
return
false
;
return
false
;
}
}
});
});
adapter
.
setOnItemClickListener
((
adapter1
,
view
,
position
)
->
{
adapter
.
setOnItemClickListener
((
adapter1
,
view
,
position
)
->
functionClick
(
mOrderingMeals
.
get
(
position
).
getResName
()));
if
(
data
.
get
(
position
).
getText
().
equals
(
"餐檯模式"
))
{
rvOrdering
.
setAdapter
(
adapter
);
}
}
private
void
functionClick
(
String
name
)
{
if
(
name
.
equals
(
"餐臺模式"
))
{
CC
.
obtainBuilder
(
"Component.Table"
)
CC
.
obtainBuilder
(
"Component.Table"
)
.
setActionName
(
"showTableActivity"
)
.
setActionName
(
"showTableActivity"
)
.
build
()
.
build
()
.
call
();
.
call
();
}
}
else
if
(
name
.
equals
(
"打印管理"
))
{
});
rvOrdering
.
setAdapter
(
adapter
);
List
<
SectionItem
>
managementData
=
new
ArrayList
<>();
managementData
.
add
(
new
SectionItem
(
R
.
drawable
.
ic_meals_menu_management
,
"餐牌管理"
));
managementData
.
add
(
new
SectionItem
(
R
.
drawable
.
ic_dining_table_management
,
"餐檯管理"
));
managementData
.
add
(
new
SectionItem
(
R
.
drawable
.
ic_print_management
,
"打印管理"
));
managementData
.
add
(
new
SectionItem
(
R
.
drawable
.
ic_pay_management
,
"支付管理"
));
managementData
.
add
(
new
SectionItem
(
R
.
drawable
.
ic_discount_management
,
"折扣管理"
));
MainOrderingAdapter
managementAdapter
=
new
MainOrderingAdapter
(
R
.
layout
.
main_home_management_funcation_item
,
managementData
);
rvManagement
.
setLayoutManager
(
new
GridLayoutManager
(
mContext
,
5
)
{
@Override
public
boolean
canScrollVertically
()
{
return
false
;
}
});
rvManagement
.
setAdapter
(
managementAdapter
);
managementAdapter
.
setOnItemClickListener
((
adapter12
,
view
,
position
)
->
{
if
(
managementData
.
get
(
position
).
getText
().
equals
(
"打印管理"
))
{
CC
.
obtainBuilder
(
"Component.Print"
)
CC
.
obtainBuilder
(
"Component.Print"
)
.
setActionName
(
"showPrintActivity"
)
.
setActionName
(
"showPrintActivity"
)
.
build
()
.
build
()
.
call
();
.
call
();
}
}
});
List
<
SectionItem
>
staffData
=
new
ArrayList
<>();
staffData
.
add
(
new
SectionItem
(
R
.
drawable
.
ic_staff_management
,
"員工管理"
));
staffData
.
add
(
new
SectionItem
(
R
.
drawable
.
ic_authority_management
,
"權限管理"
));
staffData
.
add
(
new
SectionItem
(
R
.
drawable
.
ic_operation_record
,
"操作記錄"
));
MainOrderingAdapter
staffAdapter
=
new
MainOrderingAdapter
(
R
.
layout
.
main_home_management_funcation_item
,
staffData
);
rvStaffManagement
.
setLayoutManager
(
new
GridLayoutManager
(
mContext
,
4
)
{
@Override
public
boolean
canScrollVertically
()
{
return
false
;
}
});
rvStaffManagement
.
setAdapter
(
staffAdapter
);
}
}
private
void
setTitleInfo
()
{
private
void
setTitleInfo
()
{
...
...
main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/adapter/MainOrderingAdapter.java
View file @
4522d151
...
@@ -2,8 +2,8 @@ package com.gingersoft.gsa.cloud.main.mvp.ui.adapter;
...
@@ -2,8 +2,8 @@ package com.gingersoft.gsa.cloud.main.mvp.ui.adapter;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.chad.library.adapter.base.BaseViewHolder
;
import
com.chad.library.adapter.base.BaseViewHolder
;
import
com.gingersoft.gsa.cloud.database.bean.Function
;
import
com.gingersoft.gsa.cloud.main.R
;
import
com.gingersoft.gsa.cloud.main.R
;
import
com.gingersoft.gsa.cloud.main.mvp.model.bean.SectionItem
;
import
java.util.List
;
import
java.util.List
;
...
@@ -13,8 +13,8 @@ import androidx.annotation.Nullable;
...
@@ -13,8 +13,8 @@ import androidx.annotation.Nullable;
* Created by Wyh on 2020/2/19.
* Created by Wyh on 2020/2/19.
* 首頁點餐
* 首頁點餐
*/
*/
public
class
MainOrderingAdapter
extends
BaseQuickAdapter
<
SectionItem
,
BaseViewHolder
>
{
public
class
MainOrderingAdapter
extends
BaseQuickAdapter
<
Function
,
BaseViewHolder
>
{
public
MainOrderingAdapter
(
int
layoutResId
,
@Nullable
List
<
SectionItem
>
data
)
{
public
MainOrderingAdapter
(
int
layoutResId
,
@Nullable
List
<
Function
>
data
)
{
super
(
layoutResId
,
data
);
super
(
layoutResId
,
data
);
}
}
...
@@ -23,8 +23,8 @@ public class MainOrderingAdapter extends BaseQuickAdapter<SectionItem, BaseViewH
...
@@ -23,8 +23,8 @@ public class MainOrderingAdapter extends BaseQuickAdapter<SectionItem, BaseViewH
// }
// }
@Override
@Override
protected
void
convert
(
BaseViewHolder
helper
,
SectionItem
item
)
{
protected
void
convert
(
BaseViewHolder
helper
,
Function
item
)
{
helper
.
setImageResource
(
R
.
id
.
iv_main_home_item_function_icon
,
item
.
getImage
());
// helper.setImageResource(R.id.iv_main_home_item_function_icon, item.getImageURL
());
helper
.
setText
(
R
.
id
.
tv_main_home_item_function_name
,
item
.
get
Text
());
helper
.
setText
(
R
.
id
.
tv_main_home_item_function_name
,
item
.
get
ResName
());
}
}
}
}
print-module/build.gradle
View file @
4522d151
...
@@ -40,7 +40,6 @@ android {
...
@@ -40,7 +40,6 @@ android {
dependencies
{
dependencies
{
implementation
fileTree
(
include:
[
'*.jar'
],
dir:
'libs'
)
implementation
fileTree
(
include:
[
'*.jar'
],
dir:
'libs'
)
implementation
files
(
'libs/nexgon5lib.jar'
)
implementation
'androidx.appcompat:appcompat:1.1.0'
implementation
'androidx.appcompat:appcompat:1.1.0'
androidTestImplementation
'androidx.test:runner:1.2.0'
androidTestImplementation
'androidx.test:runner:1.2.0'
androidTestImplementation
'androidx.test.espresso:espresso-core:3.2.0'
androidTestImplementation
'androidx.test.espresso:espresso-core:3.2.0'
...
...
print-module/src/main/java/com/joe/print/mvp/ui/activity/PrintActivity.java
View file @
4522d151
...
@@ -18,11 +18,9 @@ import com.gingersoft.gsa.cloud.base.common.bean.PrinterManger.PrinterManager;
...
@@ -18,11 +18,9 @@ import com.gingersoft.gsa.cloud.base.common.bean.PrinterManger.PrinterManager;
import
com.gingersoft.gsa.cloud.base.utils.constans.Constans
;
import
com.gingersoft.gsa.cloud.base.utils.constans.Constans
;
import
com.gingersoft.gsa.cloud.base.utils.other.SPUtils
;
import
com.gingersoft.gsa.cloud.base.utils.other.SPUtils
;
import
com.gingersoft.gsa.cloud.base.utils.toast.ToastUtils
;
import
com.gingersoft.gsa.cloud.base.utils.toast.ToastUtils
;
import
com.gingersoft.gsa.cloud.base.utils.view.ImageUtils
;
import
com.gingersoft.gsa.cloud.base.widget.DialogUtils
;
import
com.gingersoft.gsa.cloud.base.widget.DialogUtils
;
import
com.gingersoft.gsa.cloud.database.bean.PrinterDeviceBean
;
import
com.gingersoft.gsa.cloud.database.bean.PrinterDeviceBean
;
import
com.hyweb.n5.lib.constant.PrinterConstant
;
import
com.hyweb.n5.lib.constant.PrinterConstant
;
import
com.hyweb.n5.lib.exception.NoInitPrinterException
;
import
com.hyweb.n5.lib.util.PrinterUtil
;
import
com.hyweb.n5.lib.util.PrinterUtil
;
import
com.hyweb.n5.server.aidl.IOnPrintCallback
;
import
com.hyweb.n5.server.aidl.IOnPrintCallback
;
import
com.jess.arms.base.BaseActivity
;
import
com.jess.arms.base.BaseActivity
;
...
@@ -183,7 +181,6 @@ public class PrintActivity extends BaseActivity<PrintPresenter> implements Print
...
@@ -183,7 +181,6 @@ public class PrintActivity extends BaseActivity<PrintPresenter> implements Print
}
else
if
(
mN5
.
contains
(
model
))
{
}
else
if
(
mN5
.
contains
(
model
))
{
//N5打印
//N5打印
try
{
try
{
PrinterUtil
.
initPrinter
(
mContext
);
PrinterUtil
.
appendImage
(
bitmap
,
PrinterConstant
.
ALIGN_CENTER
);
PrinterUtil
.
appendImage
(
bitmap
,
PrinterConstant
.
ALIGN_CENTER
);
PrinterUtil
.
startPrint
(
true
,
new
IOnPrintCallback
()
{
PrinterUtil
.
startPrint
(
true
,
new
IOnPrintCallback
()
{
@Override
@Override
...
@@ -205,7 +202,7 @@ public class PrintActivity extends BaseActivity<PrintPresenter> implements Print
...
@@ -205,7 +202,7 @@ public class PrintActivity extends BaseActivity<PrintPresenter> implements Print
return
null
;
return
null
;
}
}
});
});
}
catch
(
RemoteException
|
NoInitPrinterException
e
)
{
}
catch
(
RemoteException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
printFile
();
printFile
();
}
}
...
@@ -233,15 +230,6 @@ public class PrintActivity extends BaseActivity<PrintPresenter> implements Print
...
@@ -233,15 +230,6 @@ public class PrintActivity extends BaseActivity<PrintPresenter> implements Print
finish
();
finish
();
}
}
//初始化打印內容
public
Bitmap
initPrintBitmap
(
int
width
)
{
Bitmap
bitmap
=
getIntent
().
getParcelableExtra
(
"bitmap"
);
if
(
bitmap
==
null
)
{
return
null
;
}
return
ImageUtils
.
zoomDrawable
(
bitmap
,
width
,
bitmap
.
getHeight
());
}
@Override
@Override
public
void
initIntent
()
{
public
void
initIntent
()
{
...
...
public-base/build.gradle
View file @
4522d151
...
@@ -67,7 +67,6 @@ dependencies {
...
@@ -67,7 +67,6 @@ dependencies {
testImplementation
rootProject
.
ext
.
dependencies
[
"canary-release"
]
testImplementation
rootProject
.
ext
.
dependencies
[
"canary-release"
]
annotationProcessor
rootProject
.
ext
.
dependencies
[
"dagger2-compiler"
]
annotationProcessor
rootProject
.
ext
.
dependencies
[
"dagger2-compiler"
]
implementation
rootProject
.
ext
.
dependencies
[
"BaseRecyclerViewAdapter"
]
implementation
rootProject
.
ext
.
dependencies
[
"BaseRecyclerViewAdapter"
]
// implementation 'androidx.appcompat:appcompat:1.1.0'
// implementation 'androidx.appcompat:appcompat:1.1.0'
testImplementation
'junit:junit:4.12'
testImplementation
'junit:junit:4.12'
androidTestImplementation
'androidx.test:runner:1.2.0'
androidTestImplementation
'androidx.test:runner:1.2.0'
...
@@ -80,11 +79,12 @@ dependencies {
...
@@ -80,11 +79,12 @@ dependencies {
implementation
'org.greenrobot:greendao-generator:3.2.2'
implementation
'org.greenrobot:greendao-generator:3.2.2'
implementation
rootProject
.
ext
.
dependencies
[
"BaseRecyclerViewAdapter"
]
implementation
rootProject
.
ext
.
dependencies
[
"BaseRecyclerViewAdapter"
]
implementation
'com.android.support:design:28.0.0'
implementation
'com.android.support:design:28.0.0'
implementation
'com.gcssloop.recyclerview:pagerlayoutmanager:2.3.8'
implementation
'com.gcssloop.recyclerview:pagerlayoutmanager:2.3.8'
//陰影背景
//陰影背景
// implementation 'com.github.Liberuman:ShadowDrawable:0.1'
// implementation 'com.github.Liberuman:ShadowDrawable:0.1'
api
'com.github.lihangleo2:ShadowLayout:2.1.6'
api
'com.github.lihangleo2:ShadowLayout:2.1.6'
api
'com.contrarywind:Android-PickerView:3.2.4'
//時間選擇控件
api
'com.contrarywind:Android-PickerView:3.2.4'
//時間選擇控件
implementation
'org.aspectj:aspectjrt:1.8.9'
implementation
'org.aspectj:aspectjrt:1.8.9'
api
files
(
'libs/nexgon5lib.jar'
)
}
}
p
rint-modul
e/libs/nexgon5lib.jar
→
p
ublic-bas
e/libs/nexgon5lib.jar
View file @
4522d151
File moved
public-base/src/main/java/com/gingersoft/gsa/cloud/base/application/GsaCloudApplication.java
View file @
4522d151
...
@@ -2,6 +2,8 @@ package com.gingersoft.gsa.cloud.base.application;
...
@@ -2,6 +2,8 @@ package com.gingersoft.gsa.cloud.base.application;
import
android.app.Activity
;
import
android.app.Activity
;
import
android.content.Context
;
import
android.content.Context
;
import
android.os.Build
;
import
android.os.RemoteException
;
import
com.billy.cc.core.component.CC
;
import
com.billy.cc.core.component.CC
;
import
com.elvishew.xlog.LogConfiguration
;
import
com.elvishew.xlog.LogConfiguration
;
...
@@ -16,13 +18,14 @@ import com.elvishew.xlog.printer.file.clean.FileLastModifiedCleanStrategy;
...
@@ -16,13 +18,14 @@ import com.elvishew.xlog.printer.file.clean.FileLastModifiedCleanStrategy;
import
com.elvishew.xlog.printer.file.naming.DateFileNameGenerator
;
import
com.elvishew.xlog.printer.file.naming.DateFileNameGenerator
;
import
com.gingersoft.gsa.cloud.base.BuildConfig
;
import
com.gingersoft.gsa.cloud.base.BuildConfig
;
import
com.gingersoft.gsa.cloud.base.common.bean.CurrentAndroidSetting
;
import
com.gingersoft.gsa.cloud.base.common.bean.CurrentAndroidSetting
;
import
com.gingersoft.gsa.cloud.base.utils.constans.HttpsConstans
;
import
com.gingersoft.gsa.cloud.base.utils.constans.UserConstans
;
import
com.gingersoft.gsa.cloud.base.utils.constans.UserConstans
;
import
com.gingersoft.gsa.cloud.base.utils.crash.AppCrashHandler
;
import
com.gingersoft.gsa.cloud.base.utils.crash.AppCrashHandler
;
import
com.gingersoft.gsa.cloud.base.utils.file.FileUtils
;
import
com.gingersoft.gsa.cloud.base.utils.file.FileUtils
;
import
com.gingersoft.gsa.cloud.base.utils.other.SPUtils
;
import
com.gingersoft.gsa.cloud.base.utils.other.SPUtils
;
import
com.gingersoft.gsa.cloud.base.utils.xlog.MyBackupStrategy
;
import
com.gingersoft.gsa.cloud.base.utils.xlog.MyBackupStrategy
;
import
com.gingersoft.gsa.cloud.database.DaoManager
;
import
com.gingersoft.gsa.cloud.database.DaoManager
;
import
com.hyweb.n5.lib.exception.NoInitPrinterException
;
import
com.hyweb.n5.lib.util.PrinterUtil
;
import
com.jess.arms.base.BaseApplication
;
import
com.jess.arms.base.BaseApplication
;
/**
/**
...
@@ -43,6 +46,11 @@ public class GsaCloudApplication extends BaseApplication {
...
@@ -43,6 +46,11 @@ public class GsaCloudApplication extends BaseApplication {
public
static
boolean
isLogin
=
false
;
public
static
boolean
isLogin
=
false
;
public
static
CurrentAndroidSetting
androidSetting
;
public
static
CurrentAndroidSetting
androidSetting
;
public
static
String
userName
=
""
;
public
static
String
userName
=
""
;
/**
* 商米:V2、V2_PRO N5:N5
*/
public
static
String
mV2
=
"V2,V2_PRO"
;
public
static
String
mN5
=
"N5"
;
@Override
@Override
public
void
onCreate
()
{
public
void
onCreate
()
{
...
@@ -55,9 +63,19 @@ public class GsaCloudApplication extends BaseApplication {
...
@@ -55,9 +63,19 @@ public class GsaCloudApplication extends BaseApplication {
//初始化日誌管理庫
//初始化日誌管理庫
initXLog
();
initXLog
();
initGreenDao
();
initGreenDao
();
AppCrashHandler
.
getInstance
().
init
(
this
,
"test"
);
AppCrashHandler
.
getInstance
().
init
(
this
,
"test"
);
androidSetting
=
new
CurrentAndroidSetting
();
androidSetting
=
new
CurrentAndroidSetting
();
if
(
mV2
.
contains
(
Build
.
MODEL
))
{
}
else
if
(
mN5
.
contains
(
Build
.
MODEL
))
{
try
{
//初始化N5打印
PrinterUtil
.
initPrinter
(
this
);
}
catch
(
NoInitPrinterException
|
RemoteException
e
)
{
e
.
printStackTrace
();
}
}
}
}
public
Activity
getCurrentActivity
()
{
public
Activity
getCurrentActivity
()
{
...
@@ -160,6 +178,7 @@ public class GsaCloudApplication extends BaseApplication {
...
@@ -160,6 +178,7 @@ public class GsaCloudApplication extends BaseApplication {
public
static
void
setBrandId
(
Context
context
,
int
restaurantId
)
{
public
static
void
setBrandId
(
Context
context
,
int
restaurantId
)
{
SPUtils
.
put
(
context
,
UserConstans
.
brandId
,
restaurantId
);
SPUtils
.
put
(
context
,
UserConstans
.
brandId
,
restaurantId
);
}
}
public
static
void
setBrandName
(
Context
context
,
String
restaurantName
)
{
public
static
void
setBrandName
(
Context
context
,
String
restaurantName
)
{
SPUtils
.
put
(
context
,
UserConstans
.
brandName
,
restaurantName
);
SPUtils
.
put
(
context
,
UserConstans
.
brandName
,
restaurantName
);
}
}
...
@@ -167,9 +186,11 @@ public class GsaCloudApplication extends BaseApplication {
...
@@ -167,9 +186,11 @@ public class GsaCloudApplication extends BaseApplication {
public
static
void
setRestaurantId
(
Context
context
,
int
restaurantId
)
{
public
static
void
setRestaurantId
(
Context
context
,
int
restaurantId
)
{
SPUtils
.
put
(
context
,
UserConstans
.
restaurantId
,
restaurantId
);
SPUtils
.
put
(
context
,
UserConstans
.
restaurantId
,
restaurantId
);
}
}
public
static
void
setRestaurantName
(
Context
context
,
String
restaurantName
)
{
public
static
void
setRestaurantName
(
Context
context
,
String
restaurantName
)
{
SPUtils
.
put
(
context
,
UserConstans
.
restaurantName
,
restaurantName
);
SPUtils
.
put
(
context
,
UserConstans
.
restaurantName
,
restaurantName
);
}
}
public
static
void
setBrandRestaurantInfos
(
Context
context
,
String
brandRestaurantIds
)
{
public
static
void
setBrandRestaurantInfos
(
Context
context
,
String
brandRestaurantIds
)
{
SPUtils
.
put
(
context
,
UserConstans
.
brandRestaurantInfos
,
brandRestaurantIds
);
SPUtils
.
put
(
context
,
UserConstans
.
brandRestaurantInfos
,
brandRestaurantIds
);
}
}
...
...
public-base/src/main/java/com/gingersoft/gsa/cloud/database/bean/Function.java
View file @
4522d151
...
@@ -25,6 +25,9 @@ public class Function {
...
@@ -25,6 +25,9 @@ public class Function {
@NotNull
@NotNull
private
Long
id
;
private
Long
id
;
private
int
parentId
;
private
int
groupId
;
private
int
status
;
private
int
status
;
private
long
effectiveTime
;
private
long
effectiveTime
;
private
String
resName
;
private
String
resName
;
...
@@ -52,11 +55,13 @@ public class Function {
...
@@ -52,11 +55,13 @@ public class Function {
private
int
textSizeRes
;
private
int
textSizeRes
;
@Generated
(
hash
=
11
34214411
)
@Generated
(
hash
=
11
65180133
)
public
Function
(
Long
dbid
,
@NotNull
Long
id
,
int
status
,
long
effectiveTime
,
public
Function
(
Long
dbid
,
@NotNull
Long
id
,
int
parentId
,
int
groupId
,
int
status
,
String
resName
,
String
resUrl
,
String
imageURL
)
{
long
effectiveTime
,
String
resName
,
String
resUrl
,
String
imageURL
)
{
this
.
dbid
=
dbid
;
this
.
dbid
=
dbid
;
this
.
id
=
id
;
this
.
id
=
id
;
this
.
parentId
=
parentId
;
this
.
groupId
=
groupId
;
this
.
status
=
status
;
this
.
status
=
status
;
this
.
effectiveTime
=
effectiveTime
;
this
.
effectiveTime
=
effectiveTime
;
this
.
resName
=
resName
;
this
.
resName
=
resName
;
...
@@ -221,4 +226,20 @@ public class Function {
...
@@ -221,4 +226,20 @@ public class Function {
public
void
setDbid
(
Long
dbid
)
{
public
void
setDbid
(
Long
dbid
)
{
this
.
dbid
=
dbid
;
this
.
dbid
=
dbid
;
}
}
public
int
getParentId
()
{
return
this
.
parentId
;
}
public
void
setParentId
(
int
parentId
)
{
this
.
parentId
=
parentId
;
}
public
int
getGroupId
()
{
return
this
.
groupId
;
}
public
void
setGroupId
(
int
groupId
)
{
this
.
groupId
=
groupId
;
}
}
}
public-base/src/main/java/com/gingersoft/gsa/cloud/database/greendao/FunctionDao.java
View file @
4522d151
...
@@ -26,11 +26,13 @@ public class FunctionDao extends AbstractDao<Function, Long> {
...
@@ -26,11 +26,13 @@ public class FunctionDao extends AbstractDao<Function, Long> {
public
static
class
Properties
{
public
static
class
Properties
{
public
final
static
Property
Dbid
=
new
Property
(
0
,
Long
.
class
,
"dbid"
,
true
,
"_id"
);
public
final
static
Property
Dbid
=
new
Property
(
0
,
Long
.
class
,
"dbid"
,
true
,
"_id"
);
public
final
static
Property
Id
=
new
Property
(
1
,
Long
.
class
,
"id"
,
false
,
"ID"
);
public
final
static
Property
Id
=
new
Property
(
1
,
Long
.
class
,
"id"
,
false
,
"ID"
);
public
final
static
Property
Status
=
new
Property
(
2
,
int
.
class
,
"status"
,
false
,
"STATUS"
);
public
final
static
Property
ParentId
=
new
Property
(
2
,
int
.
class
,
"parentId"
,
false
,
"PARENT_ID"
);
public
final
static
Property
EffectiveTime
=
new
Property
(
3
,
long
.
class
,
"effectiveTime"
,
false
,
"EFFECTIVE_TIME"
);
public
final
static
Property
GroupId
=
new
Property
(
3
,
int
.
class
,
"groupId"
,
false
,
"GROUP_ID"
);
public
final
static
Property
ResName
=
new
Property
(
4
,
String
.
class
,
"resName"
,
false
,
"RES_NAME"
);
public
final
static
Property
Status
=
new
Property
(
4
,
int
.
class
,
"status"
,
false
,
"STATUS"
);
public
final
static
Property
ResUrl
=
new
Property
(
5
,
String
.
class
,
"resUrl"
,
false
,
"RES_URL"
);
public
final
static
Property
EffectiveTime
=
new
Property
(
5
,
long
.
class
,
"effectiveTime"
,
false
,
"EFFECTIVE_TIME"
);
public
final
static
Property
ImageURL
=
new
Property
(
6
,
String
.
class
,
"imageURL"
,
false
,
"IMAGE_URL"
);
public
final
static
Property
ResName
=
new
Property
(
6
,
String
.
class
,
"resName"
,
false
,
"RES_NAME"
);
public
final
static
Property
ResUrl
=
new
Property
(
7
,
String
.
class
,
"resUrl"
,
false
,
"RES_URL"
);
public
final
static
Property
ImageURL
=
new
Property
(
8
,
String
.
class
,
"imageURL"
,
false
,
"IMAGE_URL"
);
}
}
...
@@ -48,11 +50,13 @@ public class FunctionDao extends AbstractDao<Function, Long> {
...
@@ -48,11 +50,13 @@ public class FunctionDao extends AbstractDao<Function, Long> {
db
.
execSQL
(
"CREATE TABLE "
+
constraint
+
"\"FUNCTION\" ("
+
//
db
.
execSQL
(
"CREATE TABLE "
+
constraint
+
"\"FUNCTION\" ("
+
//
"\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ,"
+
// 0: dbid
"\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ,"
+
// 0: dbid
"\"ID\" INTEGER NOT NULL ,"
+
// 1: id
"\"ID\" INTEGER NOT NULL ,"
+
// 1: id
"\"STATUS\" INTEGER NOT NULL ,"
+
// 2: status
"\"PARENT_ID\" INTEGER NOT NULL ,"
+
// 2: parentId
"\"EFFECTIVE_TIME\" INTEGER NOT NULL ,"
+
// 3: effectiveTime
"\"GROUP_ID\" INTEGER NOT NULL ,"
+
// 3: groupId
"\"RES_NAME\" TEXT,"
+
// 4: resName
"\"STATUS\" INTEGER NOT NULL ,"
+
// 4: status
"\"RES_URL\" TEXT,"
+
// 5: resUrl
"\"EFFECTIVE_TIME\" INTEGER NOT NULL ,"
+
// 5: effectiveTime
"\"IMAGE_URL\" TEXT);"
);
// 6: imageURL
"\"RES_NAME\" TEXT,"
+
// 6: resName
"\"RES_URL\" TEXT,"
+
// 7: resUrl
"\"IMAGE_URL\" TEXT);"
);
// 8: imageURL
}
}
/** Drops the underlying database table. */
/** Drops the underlying database table. */
...
@@ -70,22 +74,24 @@ public class FunctionDao extends AbstractDao<Function, Long> {
...
@@ -70,22 +74,24 @@ public class FunctionDao extends AbstractDao<Function, Long> {
stmt
.
bindLong
(
1
,
dbid
);
stmt
.
bindLong
(
1
,
dbid
);
}
}
stmt
.
bindLong
(
2
,
entity
.
getId
());
stmt
.
bindLong
(
2
,
entity
.
getId
());
stmt
.
bindLong
(
3
,
entity
.
getStatus
());
stmt
.
bindLong
(
3
,
entity
.
getParentId
());
stmt
.
bindLong
(
4
,
entity
.
getEffectiveTime
());
stmt
.
bindLong
(
4
,
entity
.
getGroupId
());
stmt
.
bindLong
(
5
,
entity
.
getStatus
());
stmt
.
bindLong
(
6
,
entity
.
getEffectiveTime
());
String
resName
=
entity
.
getResName
();
String
resName
=
entity
.
getResName
();
if
(
resName
!=
null
)
{
if
(
resName
!=
null
)
{
stmt
.
bindString
(
5
,
resName
);
stmt
.
bindString
(
7
,
resName
);
}
}
String
resUrl
=
entity
.
getResUrl
();
String
resUrl
=
entity
.
getResUrl
();
if
(
resUrl
!=
null
)
{
if
(
resUrl
!=
null
)
{
stmt
.
bindString
(
6
,
resUrl
);
stmt
.
bindString
(
8
,
resUrl
);
}
}
String
imageURL
=
entity
.
getImageURL
();
String
imageURL
=
entity
.
getImageURL
();
if
(
imageURL
!=
null
)
{
if
(
imageURL
!=
null
)
{
stmt
.
bindString
(
7
,
imageURL
);
stmt
.
bindString
(
9
,
imageURL
);
}
}
}
}
...
@@ -98,22 +104,24 @@ public class FunctionDao extends AbstractDao<Function, Long> {
...
@@ -98,22 +104,24 @@ public class FunctionDao extends AbstractDao<Function, Long> {
stmt
.
bindLong
(
1
,
dbid
);
stmt
.
bindLong
(
1
,
dbid
);
}
}
stmt
.
bindLong
(
2
,
entity
.
getId
());
stmt
.
bindLong
(
2
,
entity
.
getId
());
stmt
.
bindLong
(
3
,
entity
.
getStatus
());
stmt
.
bindLong
(
3
,
entity
.
getParentId
());
stmt
.
bindLong
(
4
,
entity
.
getEffectiveTime
());
stmt
.
bindLong
(
4
,
entity
.
getGroupId
());
stmt
.
bindLong
(
5
,
entity
.
getStatus
());
stmt
.
bindLong
(
6
,
entity
.
getEffectiveTime
());
String
resName
=
entity
.
getResName
();
String
resName
=
entity
.
getResName
();
if
(
resName
!=
null
)
{
if
(
resName
!=
null
)
{
stmt
.
bindString
(
5
,
resName
);
stmt
.
bindString
(
7
,
resName
);
}
}
String
resUrl
=
entity
.
getResUrl
();
String
resUrl
=
entity
.
getResUrl
();
if
(
resUrl
!=
null
)
{
if
(
resUrl
!=
null
)
{
stmt
.
bindString
(
6
,
resUrl
);
stmt
.
bindString
(
8
,
resUrl
);
}
}
String
imageURL
=
entity
.
getImageURL
();
String
imageURL
=
entity
.
getImageURL
();
if
(
imageURL
!=
null
)
{
if
(
imageURL
!=
null
)
{
stmt
.
bindString
(
7
,
imageURL
);
stmt
.
bindString
(
9
,
imageURL
);
}
}
}
}
...
@@ -127,11 +135,13 @@ public class FunctionDao extends AbstractDao<Function, Long> {
...
@@ -127,11 +135,13 @@ public class FunctionDao extends AbstractDao<Function, Long> {
Function
entity
=
new
Function
(
//
Function
entity
=
new
Function
(
//
cursor
.
isNull
(
offset
+
0
)
?
null
:
cursor
.
getLong
(
offset
+
0
),
// dbid
cursor
.
isNull
(
offset
+
0
)
?
null
:
cursor
.
getLong
(
offset
+
0
),
// dbid
cursor
.
getLong
(
offset
+
1
),
// id
cursor
.
getLong
(
offset
+
1
),
// id
cursor
.
getInt
(
offset
+
2
),
// status
cursor
.
getInt
(
offset
+
2
),
// parentId
cursor
.
getLong
(
offset
+
3
),
// effectiveTime
cursor
.
getInt
(
offset
+
3
),
// groupId
cursor
.
isNull
(
offset
+
4
)
?
null
:
cursor
.
getString
(
offset
+
4
),
// resName
cursor
.
getInt
(
offset
+
4
),
// status
cursor
.
isNull
(
offset
+
5
)
?
null
:
cursor
.
getString
(
offset
+
5
),
// resUrl
cursor
.
getLong
(
offset
+
5
),
// effectiveTime
cursor
.
isNull
(
offset
+
6
)
?
null
:
cursor
.
getString
(
offset
+
6
)
// imageURL
cursor
.
isNull
(
offset
+
6
)
?
null
:
cursor
.
getString
(
offset
+
6
),
// resName
cursor
.
isNull
(
offset
+
7
)
?
null
:
cursor
.
getString
(
offset
+
7
),
// resUrl
cursor
.
isNull
(
offset
+
8
)
?
null
:
cursor
.
getString
(
offset
+
8
)
// imageURL
);
);
return
entity
;
return
entity
;
}
}
...
@@ -140,11 +150,13 @@ public class FunctionDao extends AbstractDao<Function, Long> {
...
@@ -140,11 +150,13 @@ public class FunctionDao extends AbstractDao<Function, Long> {
public
void
readEntity
(
Cursor
cursor
,
Function
entity
,
int
offset
)
{
public
void
readEntity
(
Cursor
cursor
,
Function
entity
,
int
offset
)
{
entity
.
setDbid
(
cursor
.
isNull
(
offset
+
0
)
?
null
:
cursor
.
getLong
(
offset
+
0
));
entity
.
setDbid
(
cursor
.
isNull
(
offset
+
0
)
?
null
:
cursor
.
getLong
(
offset
+
0
));
entity
.
setId
(
cursor
.
getLong
(
offset
+
1
));
entity
.
setId
(
cursor
.
getLong
(
offset
+
1
));
entity
.
setStatus
(
cursor
.
getInt
(
offset
+
2
));
entity
.
setParentId
(
cursor
.
getInt
(
offset
+
2
));
entity
.
setEffectiveTime
(
cursor
.
getLong
(
offset
+
3
));
entity
.
setGroupId
(
cursor
.
getInt
(
offset
+
3
));
entity
.
setResName
(
cursor
.
isNull
(
offset
+
4
)
?
null
:
cursor
.
getString
(
offset
+
4
));
entity
.
setStatus
(
cursor
.
getInt
(
offset
+
4
));
entity
.
setResUrl
(
cursor
.
isNull
(
offset
+
5
)
?
null
:
cursor
.
getString
(
offset
+
5
));
entity
.
setEffectiveTime
(
cursor
.
getLong
(
offset
+
5
));
entity
.
setImageURL
(
cursor
.
isNull
(
offset
+
6
)
?
null
:
cursor
.
getString
(
offset
+
6
));
entity
.
setResName
(
cursor
.
isNull
(
offset
+
6
)
?
null
:
cursor
.
getString
(
offset
+
6
));
entity
.
setResUrl
(
cursor
.
isNull
(
offset
+
7
)
?
null
:
cursor
.
getString
(
offset
+
7
));
entity
.
setImageURL
(
cursor
.
isNull
(
offset
+
8
)
?
null
:
cursor
.
getString
(
offset
+
8
));
}
}
@Override
@Override
...
...
user-login/src/main/AndroidManifest.xml
View file @
4522d151
...
@@ -16,20 +16,23 @@
...
@@ -16,20 +16,23 @@
android:allowBackup=
"true"
android:allowBackup=
"true"
android:icon=
"@mipmap/ic_launcher"
android:icon=
"@mipmap/ic_launcher"
android:label=
"@string/user_login_name"
android:label=
"@string/user_login_name"
tools:replace=
"android:label"
android:networkSecurityConfig=
"@xml/network_android"
android:networkSecurityConfig=
"@xml/network_android"
android:roundIcon=
"@mipmap/ic_logo"
android:roundIcon=
"@mipmap/ic_logo"
android:supportsRtl=
"true"
android:supportsRtl=
"true"
android:theme=
"@style/AppTheme"
>
android:theme=
"@style/AppTheme"
tools:replace=
"android:label"
>
<activity
android:name=
".mvp.ui.activity.LoginActivity"
<activity
android:name=
".mvp.ui.activity.LoginActivity"
android:launchMode=
"singleTop"
>
android:launchMode=
"singleTop"
>
<intent-filter>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
<action
android:name=
"android.intent.action.MAIN"
/>
<action
android:name=
"android.intent.action.VIEW"
/>
<action
android:name=
"android.intent.action.VIEW"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
</intent-filter>
</intent-filter>
</activity>
</activity>
<activity
android:name=
".mvp.ui.activity.SwitchServerActivity"
/>
<meta-data
<meta-data
android:name=
"com.gingersoft.gsa.cloud.globalconfig.GlobalConfiguration"
android:name=
"com.gingersoft.gsa.cloud.globalconfig.GlobalConfiguration"
...
...
user-login/src/main/java/com/gingersoft/gsa/cloud/user/login/mvp/ui/activity/SwitchServerActivity.java
View file @
4522d151
...
@@ -80,6 +80,7 @@ public class SwitchServerActivity extends BaseActivity<SwitchServerPresenter> im
...
@@ -80,6 +80,7 @@ public class SwitchServerActivity extends BaseActivity<SwitchServerPresenter> im
HttpsConstans
.
ROOT_SERVER_ADDRESS_FORMAL
=
HttpsConstans
.
ROOT_SERVER_ADDRESS_FORMAL_HK
;
HttpsConstans
.
ROOT_SERVER_ADDRESS_FORMAL
=
HttpsConstans
.
ROOT_SERVER_ADDRESS_FORMAL_HK
;
}
}
finish
();
finish
();
startActivity
(
new
Intent
(
mContext
,
LoginActivity
.
class
));
});
});
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment