Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
abook_check
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
abook_android
abook_check
Commits
c73df9b5
Commit
c73df9b5
authored
Jan 12, 2021
by
Lee Munkyeong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modify for offline
parent
4bf67f13
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
173 additions
and
8 deletions
+173
-8
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/dao/ChatRoomDao.java
+80
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/dao/ShopMemberDao.java
+77
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/tables/RChatRoomShopMember.java
+0
-2
ABVJE_BL/src/jp/agentec/abook/abv/bl/dto/ChatRoomDto.java
+1
-1
ABVJE_BL/src/jp/agentec/abook/abv/bl/dto/ShopMemberDto.java
+1
-1
ABVJE_Launcher_Android/assets/chat/public/index.html
+8
-1
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/ChatWebviewActivity.java
+6
-3
No files found.
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/dao/ChatRoomDao.java
0 → 100644
View file @
c73df9b5
package
jp
.
agentec
.
abook
.
abv
.
bl
.
data
.
dao
;
import
java.util.List
;
import
jp.agentec.abook.abv.bl.common.db.Cursor
;
import
jp.agentec.abook.abv.bl.common.log.Logger
;
import
jp.agentec.abook.abv.bl.dto.ChatRoomDto
;
import
jp.agentec.abook.abv.bl.dto.MemberInfoDto
;
import
jp.agentec.abook.abv.bl.dto.ShopMemberDto
;
public
class
ChatRoomDao
extends
AbstractDao
{
/**
* {@link ChatRoomDao} のインスタンスを初期化します。
* アンドロイドの android.content.Context のインスタンス
* @throws ClassCastException 引数のcontextが android.content.Context 又は、その継承クラスではありません。
* @since 1.0.0
*/
/*package*/
ChatRoomDao
()
{
}
@Override
protected
ChatRoomDto
convert
(
Cursor
cursor
)
{
ChatRoomDto
dto
=
new
ChatRoomDto
();
int
column
=
cursor
.
getColumnIndex
(
"chat_room_id"
);
if
(
column
!=
-
1
)
{
dto
.
chatRoomId
=
cursor
.
getInt
(
column
);
}
column
=
cursor
.
getColumnIndex
(
"chat_room_name"
);
if
(
column
!=
-
1
)
{
dto
.
chatRoomName
=
cursor
.
getString
(
column
);
}
column
=
cursor
.
getColumnIndex
(
"type"
);
if
(
column
!=
-
1
)
{
dto
.
type
=
cursor
.
getInt
(
column
);
}
column
=
cursor
.
getColumnIndex
(
"favorite_register_date"
);
if
(
column
!=
-
1
)
{
dto
.
favoriteRegisterDate
=
cursor
.
getString
(
column
);
}
return
dto
;
}
public
List
<
ChatRoomDto
>
getAllChatRoom
()
{
List
<
ChatRoomDto
>
list
=
rawQueryGetDtoList
(
"select * from t_chat_room"
,
null
,
ChatRoomDto
.
class
);
return
list
;
}
public
ChatRoomDto
getFavoriteChatRoom
()
{
return
rawQueryGetDto
(
"select * from t_chat_room where favorite_register_date is NOT NULL"
,
null
,
ChatRoomDto
.
class
);
}
public
ChatRoomDto
getNotFavoriteChatRoom
()
{
return
rawQueryGetDto
(
"select * from t_chat_room where favorite_register_date is NULL"
,
null
,
ChatRoomDto
.
class
);
}
public
void
insertChatRoom
(
ChatRoomDto
dto
)
{
insert
(
"insert into t_chat_room (chat_room_id, chat_room_name, type, favorite_register_date) values (?,?,?,?)"
,
dto
.
getInsertValues
());
}
public
boolean
updateChatRoom
(
ChatRoomDto
dto
)
{
long
count
=
update
(
"update t_chat_room set chat_room_name=?, type=?, favorite_register_date=? where chat_room_id=?"
,
dto
.
getUpdateValues
());
return
count
>
0
;
}
public
void
deleteChatRoom
()
{
try
{
beginTransaction
();
delete
(
"t_chat_room"
,
null
,
null
);
commit
();
}
catch
(
Exception
e
)
{
rollback
();
Logger
.
e
(
"deleteChatRoom failed."
,
e
);
throw
new
RuntimeException
(
e
);
}
finally
{
}
}
}
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/dao/ShopMemberDao.java
0 → 100644
View file @
c73df9b5
package
jp
.
agentec
.
abook
.
abv
.
bl
.
data
.
dao
;
import
java.util.Date
;
import
java.util.List
;
import
jp.agentec.abook.abv.bl.common.db.Cursor
;
import
jp.agentec.abook.abv.bl.common.log.Logger
;
import
jp.agentec.abook.abv.bl.dto.MemberInfoDto
;
import
jp.agentec.abook.abv.bl.dto.ShopMemberDto
;
import
jp.agentec.adf.util.DateTimeFormat
;
import
jp.agentec.adf.util.DateTimeUtil
;
public
class
ShopMemberDao
extends
AbstractDao
{
/**
* {@link ShopMemberDao} のインスタンスを初期化します。
* アンドロイドの android.content.Context のインスタンス
* @throws ClassCastException 引数のcontextが android.content.Context 又は、その継承クラスではありません。
* @since 1.0.0
*/
/*package*/
ShopMemberDao
()
{
}
@Override
protected
ShopMemberDto
convert
(
Cursor
cursor
)
{
ShopMemberDto
dto
=
new
ShopMemberDto
();
int
column
=
cursor
.
getColumnIndex
(
"shop_member_id"
);
if
(
column
!=
-
1
)
{
dto
.
shopMemberId
=
cursor
.
getInt
(
column
);
}
column
=
cursor
.
getColumnIndex
(
"shop_member_name"
);
if
(
column
!=
-
1
)
{
dto
.
shopMemberName
=
cursor
.
getString
(
column
);
}
column
=
cursor
.
getColumnIndex
(
"profile_url"
);
if
(
column
!=
-
1
)
{
dto
.
profileUrl
=
cursor
.
getString
(
column
);
}
column
=
cursor
.
getColumnIndex
(
"favorite_register_date"
);
if
(
column
!=
-
1
)
{
dto
.
favoriteRegisterDate
=
cursor
.
getString
(
column
);
}
return
dto
;
}
public
List
<
ShopMemberDto
>
getAllShopMember
()
{
List
<
ShopMemberDto
>
list
=
rawQueryGetDtoList
(
"select * from m_shop_member"
,
null
,
ShopMemberDto
.
class
);
return
list
;
}
public
ShopMemberDto
getShopMember
(
int
shopMemberId
)
{
return
rawQueryGetDto
(
"select * from m_shop_member where shop_member_id=?"
,
new
String
[]{
""
+
shopMemberId
},
ShopMemberDto
.
class
);
}
public
void
insertShopMember
(
ShopMemberDto
dto
)
{
insert
(
"insert into m_shop_member (shop_member_id, shop_member_name, profile_url, favorite_register_date) values (?,?,?,?)"
,
dto
.
getInsertValues
());
}
public
boolean
updateShopMember
(
MemberInfoDto
dto
)
{
long
count
=
update
(
"update m_shop_member set shop_member_name=?, profile_url=?, favorite_register_date=? where shop_member_id=?"
,
dto
.
getUpdateValues
());
return
count
>
0
;
}
public
void
deleteShopMember
()
{
try
{
beginTransaction
();
delete
(
"m_shop_member"
,
null
,
null
);
commit
();
}
catch
(
Exception
e
)
{
rollback
();
Logger
.
e
(
"deleteShopMember failed."
,
e
);
throw
new
RuntimeException
(
e
);
}
finally
{
}
}
}
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/tables/RChatRoomShopMember.java
View file @
c73df9b5
...
...
@@ -20,8 +20,6 @@ public class RChatRoomShopMember extends SQLiteTableScript {
sql
.
append
(
" room_id INTEGER NOT NULL "
);
sql
.
append
(
" , shop_member_id INTEGER NOT NULL "
);
sql
.
append
(
" , PRIMARY KEY (room_id, shop_member_id) "
);
sql
.
append
(
" , FOREIGN KEY (room_id) REFERENCES t_chat_room (room_id) "
);
sql
.
append
(
" , FOREIGN KEY (shop_member_id) REFERENCES m_shop_member (shop_member_id) "
);
sql
.
append
(
" ) "
);
ddl
.
add
(
sql
.
toString
());
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/dto/ChatRoomDto.java
View file @
c73df9b5
...
...
@@ -6,7 +6,7 @@ public class ChatRoomDto extends AbstractDto {
public
Integer
chatRoomId
;
public
String
chatRoomName
;
public
Integer
type
;
public
Date
favoriteRegisterDate
;
public
String
favoriteRegisterDate
;
@Override
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/dto/ShopMemberDto.java
View file @
c73df9b5
...
...
@@ -6,7 +6,7 @@ public class ShopMemberDto extends AbstractDto {
public
Integer
shopMemberId
;
public
String
shopMemberName
;
public
String
profileUrl
;
public
Date
favoriteRegisterDate
;
public
String
favoriteRegisterDate
;
@Override
public
Object
[]
getInsertValues
()
{
...
...
ABVJE_Launcher_Android/assets/chat/public/index.html
View file @
c73df9b5
...
...
@@ -14,19 +14,26 @@
String
.
prototype
.
replaceAll
=
function
(
org
,
dest
)
{
return
this
.
split
(
org
).
join
(
dest
);
}
let
CHAT_SERVER_URL
=
''
;
let
CMS_SERVER_URL
=
''
;
let
ASSET_PATH
=
'./'
;
let
PLATFORM
=
''
;
let
IS_MOBILE
=
true
;
function
getGlobalParam
(
chatServerUrl
,
cmsServerUrl
,
platform
,
isMobile
)
{
let
IS_ONLINE
=
true
;
function
getGlobalParam
(
chatServerUrl
,
cmsServerUrl
,
platform
,
isMobile
,
isOnline
)
{
console
.
log
(
'TEST get GP'
);
CHAT_SERVER_URL
=
chatServerUrl
;
CMS_SERVER_URL
=
cmsServerUrl
;
PLATFORM
=
platform
;
IS_MOBILE
=
isMobile
;
IS_ONLINE
=
isOnline
;
console
.
log
(
CHAT_SERVER_URL
);
console
.
log
(
CMS_SERVER_URL
);
console
.
log
(
isOnline
);
};
android
.
getGlobalParameter
();
</script>
</head>
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/ChatWebviewActivity.java
View file @
c73df9b5
...
...
@@ -63,8 +63,8 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
private
final
String
TAG
=
"ChatWebviewActivity"
;
private
final
String
NETWORK_ERROR_PLACE_HOLDER
=
"file:///android_asset/chat/public/
networkError
.html"
;
private
final
String
NETWORK_ERROR_PLACE_HOLDER
=
"file:///android_asset/chat/public/
index
.html"
;
//private final String NETWORK_ERROR_PLACE_HOLDER = "file:///android_asset/chat/public/networkError.html";
private
final
String
CHAT_PAGE_URL
=
"file:///android_asset/chat/public/index.html"
;
//AISDevelop
...
...
@@ -73,6 +73,7 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
private
ValueCallback
<
Uri
[]>
mUploadMessage
;
private
String
sid
,
roomName
,
loginId
,
shopName
;
private
boolean
isOnline
;
private
Long
roomId
;
public
AlertDialog
myAlertDialog
;
...
...
@@ -96,12 +97,14 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
roomName
=
intent
.
getStringExtra
(
"roomName"
);
loginId
=
intent
.
getStringExtra
(
"loginId"
);
shopName
=
intent
.
getStringExtra
(
"shopName"
);
isOnline
=
false
;
//ネットワークがない場合専用のページを表示。
chatWebviewUrl
=
NETWORK_ERROR_PLACE_HOLDER
;
if
(
ABVEnvironment
.
getInstance
().
networkAdapter
.
isNetworkConnected
())
{
try
{
if
(
AcmsClient
.
getInstance
(
ABVEnvironment
.
getInstance
().
networkAdapter
).
checkSid
(
sid
))
{
isOnline
=
true
;
chatWebviewUrl
=
CHAT_PAGE_URL
;
}
}
catch
(
Exception
e
)
{
...
...
@@ -519,7 +522,7 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
chatServerUrl
=
chatServerUrl
.
substring
(
0
,
chatServerUrl
.
length
()
-
3
);
String
cmsServerUrl
=
ABVEnvironment
.
getInstance
().
acmsAddress
+
ABVDataCache
.
getInstance
().
getUrlPath
();
mChatWebView
.
loadUrl
(
String
.
format
(
"javascript:getGlobalParam('%s', '%s', '%s', '%s'
);"
,
chatServerUrl
,
cmsServerUrl
,
"android"
,
tru
e
));
mChatWebView
.
loadUrl
(
String
.
format
(
"javascript:getGlobalParam('%s', '%s', '%s', '%s'
, '%s');"
,
chatServerUrl
,
cmsServerUrl
,
"android"
,
true
,
isOnlin
e
));
}
@Override
...
...
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