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
381469fa
Commit
381469fa
authored
Feb 04, 2021
by
Lee Munkyeong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DAO処理にトランザクション処理を追加
parent
cd300e10
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
4 deletions
+34
-4
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/json/RoomListJSON.java
+0
-1
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/dao/ChatMessageDao.java
+14
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/dao/ChatRoomDao.java
+15
-1
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/CommunicationLogic.java
+5
-2
No files found.
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/json/RoomListJSON.java
View file @
381469fa
...
...
@@ -9,7 +9,6 @@ import jp.agentec.abook.abv.bl.common.exception.AcmsException;
import
jp.agentec.abook.abv.bl.common.exception.JSONValidationException
;
import
jp.agentec.abook.abv.bl.dto.ChatMessageDto
;
import
jp.agentec.abook.abv.bl.dto.ChatRoomDto
;
import
jp.agentec.adf.util.DateTimeFormat
;
import
jp.agentec.adf.util.DateTimeUtil
;
public
class
RoomListJSON
extends
AcmsCommonJSON
{
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/dao/ChatMessageDao.java
View file @
381469fa
...
...
@@ -70,6 +70,20 @@ public class ChatMessageDao extends AbstractDao {
insert
(
"insert into t_chat_message (chat_message_id, chat_room_id, shop_member_id, message, message_type, image_name, download_file_name, save_path, insert_date) values (?,?,?,?,?,?,?,?,?)"
,
dto
.
getInsertValues
());
}
public
void
insertChatMessage
(
List
<
ChatMessageDto
>
chatMessageDtoList
)
{
try
{
beginTransaction
();
for
(
ChatMessageDto
chatMessageDto
:
chatMessageDtoList
)
{
insertChatMessage
(
chatMessageDto
);
}
commit
();
}
catch
(
Exception
e
)
{
rollback
();
Logger
.
e
(
"insertChatRoomList failed."
,
e
);
throw
new
RuntimeException
(
e
);
}
}
public
boolean
updateChatMessage
(
ChatMessageDto
dto
)
{
long
count
=
update
(
"update t_chat_message set chat_room_id=?, shop_member_id=?, message=?, message_type=?, image_name=?, download_file_name=?, save_path=?, insert_date=? where chat_message_id=?"
,
dto
.
getUpdateValues
());
return
count
>
0
;
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/dao/ChatRoomDao.java
View file @
381469fa
...
...
@@ -73,7 +73,7 @@ public class ChatRoomDao extends AbstractDao {
sql
.
append
(
" ,coalesce (cm.message,'') message"
);
sql
.
append
(
" ,coalesce (cm.message_type,0) message_type"
);
sql
.
append
(
" ,coalesce (cm.insert_date,'') insert_date"
);
sql
.
append
(
" ,coalesce (cr.user_count,0)user_count "
);
sql
.
append
(
" ,coalesce (cr.user_count,0)
user_count "
);
sql
.
append
(
" FROM "
);
sql
.
append
(
" t_chat_room AS cr "
);
sql
.
append
(
" LEFT JOIN "
);
...
...
@@ -97,6 +97,20 @@ public class ChatRoomDao extends AbstractDao {
insert
(
"insert into t_chat_room (chat_room_id, chat_room_name, type, unread_count, user_count, favorite_register_date) values (?,?,?,?,?,?)"
,
dto
.
getInsertValues
());
}
public
void
insertChatRoom
(
List
<
ChatRoomDto
>
chatRoomDtoList
)
{
try
{
beginTransaction
();
for
(
ChatRoomDto
chatRoomDto
:
chatRoomDtoList
)
{
insertChatRoom
(
chatRoomDto
);
}
commit
();
}
catch
(
Exception
e
)
{
rollback
();
Logger
.
e
(
"insertChatRoomList failed."
,
e
);
throw
new
RuntimeException
(
e
);
}
}
public
boolean
updateChatRoom
(
ChatRoomDto
dto
)
{
long
count
=
update
(
"update t_chat_room set chat_room_name=?, type=?, unread_count=?, user_count=?, favorite_register_date=? where chat_room_id=?"
,
dto
.
getUpdateValues
());
return
count
>
0
;
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/CommunicationLogic.java
View file @
381469fa
...
...
@@ -35,6 +35,7 @@ import jp.agentec.abook.abv.bl.data.dao.ContentMarkingDao;
import
jp.agentec.abook.abv.bl.data.dao.ContentPageDao
;
import
jp.agentec.abook.abv.bl.data.dao.ContentResourceDao
;
import
jp.agentec.abook.abv.bl.data.dao.ContentTagDao
;
import
jp.agentec.abook.abv.bl.dto.ChatMessageDto
;
import
jp.agentec.abook.abv.bl.dto.ChatRoomDto
;
import
jp.agentec.abook.abv.bl.dto.ContentDto
;
import
jp.agentec.abook.abv.bl.dto.ContentPageDto
;
...
...
@@ -86,12 +87,14 @@ public class CommunicationLogic extends AbstractLogic {
}
public
void
insertChatRoomList
(
List
<
ChatRoomDto
>
roomList
)
{
List
<
ChatMessageDto
>
insertMessageList
=
new
ArrayList
<
ChatMessageDto
>();
for
(
ChatRoomDto
chatRoomDto
:
roomList
)
{
chatRoomDao
.
insertChatRoom
(
chatRoomDto
);
if
(
chatRoomDto
.
lastMessageInfo
!=
null
)
{
chatMessageDao
.
insertChatMessage
(
chatRoomDto
.
lastMessageInfo
);
insertMessageList
.
add
(
chatRoomDto
.
lastMessageInfo
);
}
}
chatRoomDao
.
insertChatRoom
(
roomList
);
chatMessageDao
.
insertChatMessage
(
insertMessageList
);
}
public
void
deleteChatRoomList
()
{
...
...
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