Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
haoban3.0
haoban-manage3.0
Commits
19040ddd
Commit
19040ddd
authored
Jan 04, 2023
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
欢迎语日志
parent
59c4f1a8
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
138 additions
and
206 deletions
+138
-206
QywxErrorLogDTO.java
...n/java/com/gic/haoban/manage/api/dto/QywxErrorLogDTO.java
+18
-27
QywxErrorLogListQDTO.java
.../gic/haoban/manage/api/dto/qdto/QywxErrorLogListQDTO.java
+19
-0
QywxErrorLogApiService.java
...gic/haoban/manage/api/service/QywxErrorLogApiService.java
+0
-18
TabQywxErrorLogMapper.java
...oban/manage/service/dao/mapper/TabQywxErrorLogMapper.java
+0
-8
TabQywxErrorLog.java
...com/gic/haoban/manage/service/entity/TabQywxErrorLog.java
+16
-26
TabQywxErrorLogBO.java
.../gic/haoban/manage/service/pojo/bo/TabQywxErrorLogBO.java
+14
-23
QywxErrorLogService.java
...ic/haoban/manage/service/service/QywxErrorLogService.java
+0
-9
TabQywxErrorLogServiceImpl.java
...nage/service/service/impl/TabQywxErrorLogServiceImpl.java
+7
-29
MemberUnionidRelatedApiServiceImpl.java
.../service/out/impl/MemberUnionidRelatedApiServiceImpl.java
+31
-19
QywxErrorLogApiServiceImpl.java
.../service/service/out/impl/QywxErrorLogApiServiceImpl.java
+7
-14
TabQywxErrorLogMapper.xml
...rvice/src/main/resources/mapper/TabQywxErrorLogMapper.xml
+26
-33
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/QywxErrorLogDTO.java
View file @
19040ddd
...
...
@@ -14,45 +14,44 @@ public class QywxErrorLogDTO implements Serializable {
private
Long
id
;
private
String
wxEnterpriseId
;
private
String
corpid
;
private
String
qywxInterface
;
private
String
scenario
;
private
String
errorContent
;
private
String
weworkErrorUrl
;
private
String
traceId
;
private
Integer
qywxErrorType
;
private
Date
createTime
;
private
String
memberId
;
private
String
externalUserId
;
public
Long
get
Id
()
{
return
i
d
;
public
String
getMember
Id
()
{
return
memberI
d
;
}
public
void
setId
(
Long
id
)
{
this
.
id
=
i
d
;
public
String
getExternalUserId
(
)
{
return
externalUserI
d
;
}
public
String
getWxEnterpriseId
(
)
{
return
wxEnterprise
Id
;
public
void
setMemberId
(
String
memberId
)
{
this
.
memberId
=
member
Id
;
}
public
void
set
WxEnterpriseId
(
String
wxEnterprise
Id
)
{
this
.
wxEnterpriseId
=
wxEnterprise
Id
;
public
void
set
ExternalUserId
(
String
externalUser
Id
)
{
this
.
externalUserId
=
externalUser
Id
;
}
public
String
getCorpi
d
()
{
return
corp
id
;
public
Long
getI
d
()
{
return
id
;
}
public
void
set
Corpid
(
String
corp
id
)
{
this
.
corpid
=
corp
id
;
public
void
set
Id
(
Long
id
)
{
this
.
id
=
id
;
}
public
String
get
QywxInterface
()
{
return
qywxInterface
;
public
String
get
WxEnterpriseId
()
{
return
wxEnterpriseId
;
}
public
void
set
QywxInterface
(
String
qywxInterface
)
{
this
.
qywxInterface
=
qywxInterface
;
public
void
set
WxEnterpriseId
(
String
wxEnterpriseId
)
{
this
.
wxEnterpriseId
=
wxEnterpriseId
;
}
public
String
getScenario
()
{
...
...
@@ -71,14 +70,6 @@ public class QywxErrorLogDTO implements Serializable {
this
.
errorContent
=
errorContent
;
}
public
String
getWeworkErrorUrl
()
{
return
weworkErrorUrl
;
}
public
void
setWeworkErrorUrl
(
String
weworkErrorUrl
)
{
this
.
weworkErrorUrl
=
weworkErrorUrl
;
}
public
String
getTraceId
()
{
return
traceId
;
}
...
...
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/qdto/QywxErrorLogListQDTO.java
View file @
19040ddd
...
...
@@ -26,6 +26,25 @@ public class QywxErrorLogListQDTO extends BasePageInfo implements Serializable {
private
String
startDate
;
private
String
endDate
;
private
String
memberId
;
private
String
externalUserId
;
public
String
getMemberId
()
{
return
memberId
;
}
public
String
getExternalUserId
()
{
return
externalUserId
;
}
public
void
setMemberId
(
String
memberId
)
{
this
.
memberId
=
memberId
;
}
public
void
setExternalUserId
(
String
externalUserId
)
{
this
.
externalUserId
=
externalUserId
;
}
public
String
getScenario
()
{
return
scenario
;
}
...
...
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/QywxErrorLogApiService.java
View file @
19040ddd
...
...
@@ -15,29 +15,11 @@ public interface QywxErrorLogApiService {
/**
* 新增数据
* "routerName": "addQywxErrorLogMq",
* @param param 参数
* @return {@link QywxErrorLogDTO }
* @author mozhu
* @date 2022-04-18 17:02:40
*/
void
insertQywxErrorLog
(
String
param
);
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
QywxErrorLogDTO
queryById
(
Long
id
);
/**
* 查询分页列表
*
* @param qywxErrorLogListQDTO qdto qywx错误日志列表
* @return {@link Page }<{@link QywxErrorLogDTO }>
* @author mozhu
* @date 2022-04-18 17:01:14
*/
Page
<
QywxErrorLogDTO
>
queryListByPage
(
QywxErrorLogListQDTO
qywxErrorLogListQDTO
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/TabQywxErrorLogMapper.java
View file @
19040ddd
...
...
@@ -21,14 +21,6 @@ public interface TabQywxErrorLogMapper {
int
insert
(
TabQywxErrorLog
tabQywxErrorLog
);
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
TabQywxErrorLog
queryById
(
Long
id
);
/**
* 分页列表
*
* @param qywxErrorLogListQDTO qdto qywx错误日志列表
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/entity/TabQywxErrorLog.java
View file @
19040ddd
...
...
@@ -17,8 +17,6 @@ public class TabQywxErrorLog implements Serializable {
private
Long
id
;
private
String
wxEnterpriseId
;
private
String
corpid
;
private
String
qywxInterface
;
/**
* 场景
*/
...
...
@@ -27,10 +25,10 @@ public class TabQywxErrorLog implements Serializable {
* 报错内容
*/
private
String
errorContent
;
/**
* 企微报错url
*/
private
String
weworkErrorUrl
;
private
String
memberId
;
private
String
externalUserId
;
/**
* 链路id
*/
...
...
@@ -58,22 +56,6 @@ public class TabQywxErrorLog implements Serializable {
this
.
wxEnterpriseId
=
wxEnterpriseId
;
}
public
String
getCorpid
()
{
return
corpid
;
}
public
void
setCorpid
(
String
corpid
)
{
this
.
corpid
=
corpid
;
}
public
String
getQywxInterface
()
{
return
qywxInterface
;
}
public
void
setQywxInterface
(
String
qywxInterface
)
{
this
.
qywxInterface
=
qywxInterface
;
}
public
String
getScenario
()
{
return
scenario
;
}
...
...
@@ -90,12 +72,20 @@ public class TabQywxErrorLog implements Serializable {
this
.
errorContent
=
errorContent
;
}
public
String
getWeworkErrorUrl
()
{
return
weworkErrorUrl
;
public
String
getMemberId
()
{
return
memberId
;
}
public
String
getExternalUserId
()
{
return
externalUserId
;
}
public
void
setMemberId
(
String
memberId
)
{
this
.
memberId
=
memberId
;
}
public
void
set
WeworkErrorUrl
(
String
weworkErrorUrl
)
{
this
.
weworkErrorUrl
=
weworkErrorUrl
;
public
void
set
ExternalUserId
(
String
externalUserId
)
{
this
.
externalUserId
=
externalUserId
;
}
public
String
getTraceId
()
{
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/pojo/bo/TabQywxErrorLogBO.java
View file @
19040ddd
...
...
@@ -14,11 +14,10 @@ public class TabQywxErrorLogBO implements Serializable {
private
Long
id
;
private
String
wxEnterpriseId
;
private
String
corpi
d
;
private
String
qywxInterface
;
private
String
memberI
d
;
private
String
externalUserId
;
private
String
scenario
;
private
String
errorContent
;
private
String
weworkErrorUrl
;
private
String
traceId
;
private
Integer
qywxErrorType
;
private
Date
createTime
;
...
...
@@ -39,22 +38,6 @@ public class TabQywxErrorLogBO implements Serializable {
this
.
wxEnterpriseId
=
wxEnterpriseId
;
}
public
String
getCorpid
()
{
return
corpid
;
}
public
void
setCorpid
(
String
corpid
)
{
this
.
corpid
=
corpid
;
}
public
String
getQywxInterface
()
{
return
qywxInterface
;
}
public
void
setQywxInterface
(
String
qywxInterface
)
{
this
.
qywxInterface
=
qywxInterface
;
}
public
String
getScenario
()
{
return
scenario
;
}
...
...
@@ -71,12 +54,20 @@ public class TabQywxErrorLogBO implements Serializable {
this
.
errorContent
=
errorContent
;
}
public
String
getWeworkErrorUrl
()
{
return
weworkErrorUrl
;
public
String
getMemberId
()
{
return
memberId
;
}
public
String
getExternalUserId
()
{
return
externalUserId
;
}
public
void
setMemberId
(
String
memberId
)
{
this
.
memberId
=
memberId
;
}
public
void
set
WeworkErrorUrl
(
String
weworkErrorUrl
)
{
this
.
weworkErrorUrl
=
weworkErrorUrl
;
public
void
set
ExternalUserId
(
String
externalUserId
)
{
this
.
externalUserId
=
externalUserId
;
}
public
String
getTraceId
()
{
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/QywxErrorLogService.java
View file @
19040ddd
...
...
@@ -23,15 +23,6 @@ public interface QywxErrorLogService {
*/
TabQywxErrorLogBO
insert
(
TabQywxErrorLogBO
tabQywxErrorLogBO
);
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
TabQywxErrorLogBO
queryById
(
Long
id
);
/**
* 查询分页列表
*
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/TabQywxErrorLogServiceImpl.java
View file @
19040ddd
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
impl
;
import
java.util.Date
;
import
java.util.List
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.gic.commons.util.UniqueIdUtils
;
import
com.gic.haoban.common.utils.EntityUtil
;
import
com.gic.haoban.manage.api.dto.qdto.QywxErrorLogListQDTO
;
import
com.gic.haoban.manage.service.dao.mapper.TabQywxErrorLogMapper
;
import
com.gic.haoban.manage.service.entity.TabHaobanWxApplication
;
import
com.gic.haoban.manage.service.entity.TabQywxErrorLog
;
import
com.gic.haoban.manage.service.pojo.bo.TabQywxErrorLogBO
;
import
com.gic.haoban.manage.service.service.QywxErrorLogService
;
import
com.gic.haoban.manage.service.service.WxApplicationService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
import
java.util.List
;
/**
* 企微报错日志(TabQywxErrorLog)表服务实现类
...
...
@@ -26,27 +23,14 @@ import java.util.List;
*/
@Service
public
class
TabQywxErrorLogServiceImpl
implements
QywxErrorLogService
{
private
static
final
Logger
logger
=
LogManager
.
getLogger
(
TabQywxErrorLogServiceImpl
.
class
);
@Autowired
private
TabQywxErrorLogMapper
tabQywxErrorLogMapper
;
@Autowired
private
WxApplicationService
wxApplicationService
;
@Override
public
TabQywxErrorLogBO
insert
(
TabQywxErrorLogBO
tabQywxErrorLogBO
)
{
String
wxEnterpriseId
=
tabQywxErrorLogBO
.
getWxEnterpriseId
();
String
corpid
=
tabQywxErrorLogBO
.
getCorpid
();
if
(
StringUtils
.
isBlank
(
wxEnterpriseId
))
{
TabHaobanWxApplication
tabHaobanWxApplication
=
wxApplicationService
.
selectByCorpId
(
corpid
);
if
(
tabHaobanWxApplication
!=
null
)
{
tabQywxErrorLogBO
.
setWxEnterpriseId
(
tabHaobanWxApplication
.
getWxEnterpriseId
());
}
}
wxEnterpriseId
=
tabQywxErrorLogBO
.
getWxEnterpriseId
();
if
(
StringUtils
.
isBlank
(
wxEnterpriseId
))
{
logger
.
error
(
"企业微信id为空,corpid:{}"
,
corpid
);
return
null
;
}
tabQywxErrorLogBO
.
setId
(
UniqueIdUtils
.
uniqueLong
());
...
...
@@ -56,12 +40,6 @@ public class TabQywxErrorLogServiceImpl implements QywxErrorLogService {
}
@Override
public
TabQywxErrorLogBO
queryById
(
Long
id
)
{
TabQywxErrorLog
tabQywxErrorLog
=
this
.
tabQywxErrorLogMapper
.
queryById
(
id
);
return
EntityUtil
.
changeEntityByOrika
(
TabQywxErrorLogBO
.
class
,
tabQywxErrorLog
);
}
@Override
public
List
<
TabQywxErrorLog
>
queryListByPage
(
QywxErrorLogListQDTO
qywxErrorLogListQDTO
)
{
return
this
.
tabQywxErrorLogMapper
.
queryListByPage
(
qywxErrorLogListQDTO
);
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/MemberUnionidRelatedApiServiceImpl.java
View file @
19040ddd
...
...
@@ -215,6 +215,8 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
@Autowired
private
GroupChatService
groupChatService
;
private
static
GicMQClient
clientInstance
=
GICMQClientUtil
.
getClientInstance
();
@Override
public
void
dealQywxExternalUser
(
String
params
)
{
...
...
@@ -480,7 +482,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
TabHaobanClerkMainStoreRelated
mainStoreRelated
=
clerkMainStoreRelatedService
.
getMainStoreByStaffId
(
staffId
,
wxEnterpriseId
);
if
(
mainStoreRelated
==
null
)
{
log
.
info
(
"【新增外部联系人】主门店为空:staffId={}"
,
staffId
);
this
.
sendWelcome
(
dto
,
qwDTO
,
null
,
staffId
,
null
);
this
.
sendWelcome
(
dto
,
qwDTO
,
null
,
staffId
,
null
,
null
);
return
;
}
staffClerkRelationDTO
=
staffClerkRelationService
.
getOneBindByStoreId
(
staffId
,
mainStoreRelated
.
getStoreId
());
...
...
@@ -645,7 +647,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
}
String
storeId
=
staffClerkRelationDTO
.
getStoreId
();
this
.
saveExternalClerk
(
memberId
,
staffId
,
dto
,
staffClerkRelationDTO
,
1
);
this
.
sendWelcome
(
dto
,
qwDTO
,
enterpriseId
,
staffId
,
clerkId
);
this
.
sendWelcome
(
dto
,
qwDTO
,
enterpriseId
,
staffId
,
clerkId
,
memberId
);
//同步好友标签
this
.
pushTagSync
(
memberId
,
wxEnterpriseId
,
enterpriseId
);
//回调给会员,更新是否为企微好友
...
...
@@ -787,7 +789,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
String
clerkId
=
staffClerkRelationDTO
.
getClerkId
();
String
enterpriseId
=
staffClerkRelationDTO
.
getEnterpriseId
();
//发送欢迎语
sendWelcome
(
dto
,
qwDTO
,
enterpriseId
,
staffId
,
clerkId
);
sendWelcome
(
dto
,
qwDTO
,
enterpriseId
,
staffId
,
clerkId
,
null
);
//保存好友关系
this
.
saveExternalClerk
(
null
,
staffId
,
dto
,
staffClerkRelationDTO
,
4
);
}
...
...
@@ -800,40 +802,37 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
* @param enterpriseId
* @param staffId
*/
private
void
sendWelcome
(
MemberUnionidRelatedDTO
dto
,
WxEnterpriseQwDTO
wxEnterpriseDTO
,
String
enterpriseId
,
String
staffId
,
String
clerkId
)
{
private
void
sendWelcome
(
MemberUnionidRelatedDTO
dto
,
WxEnterpriseQwDTO
wxEnterpriseDTO
,
String
enterpriseId
,
String
staffId
,
String
clerkId
,
String
memberId
)
{
log
.
info
(
"发送欢迎语:dto:{},staffId:{}"
,
JSONObject
.
toJSONString
(
dto
),
staffId
);
String
welcomeCode
=
dto
.
getWelcomeCode
();
String
state
=
dto
.
getState
();
String
wxEnterpriseId
=
wxEnterpriseDTO
.
getWxEnterpriseId
();
QywxErrorLogDTO
errLog
=
new
QywxErrorLogDTO
();
errLog
.
setWxEnterpriseId
(
wxEnterpriseId
);
errLog
.
setMemberId
(
memberId
);
errLog
.
setExternalUserId
(
dto
.
getExternalUserid
());
errLog
.
setTraceId
(
ProviderLocalTag
.
tag
.
get
().
traceId
);
errLog
.
setQywxErrorType
(
1
);
if
(
StringUtils
.
isBlank
(
welcomeCode
))
{
log
.
error
(
"welcomeCode为空,请检查是否使用企微的欢迎语:{}"
,
wxEnterpriseId
);
GicMQClient
clientInstance
=
GICMQClientUtil
.
getClientInstance
();
try
{
QywxErrorLogDTO
qywxErrorLogDTO
=
new
QywxErrorLogDTO
();
qywxErrorLogDTO
.
setWxEnterpriseId
(
wxEnterpriseId
);
qywxErrorLogDTO
.
setCorpid
(
dto
.
getCorpid
());
qywxErrorLogDTO
.
setScenario
(
"欢迎语不发送"
);
qywxErrorLogDTO
.
setErrorContent
(
"welcomeCode为空,请检查是否使用企微的欢迎语"
);
qywxErrorLogDTO
.
setTraceId
(
ProviderLocalTag
.
tag
.
get
().
traceId
);
qywxErrorLogDTO
.
setQywxErrorType
(
1
);
clientInstance
.
sendMessage
(
Manage3Constants
.
QYWX_ERROR_MSG
,
JSON
.
toJSONString
(
qywxErrorLogDTO
));
errLog
.
setScenario
(
"欢迎语"
);
errLog
.
setErrorContent
(
"welcomeCode空,GIC不处理,使用企微发送欢迎语"
);
clientInstance
.
sendMessage
(
Manage3Constants
.
QYWX_ERROR_MSG
,
JSON
.
toJSONString
(
errLog
));
}
catch
(
Exception
e
)
{
log
.
error
(
"发送消息失败:{}"
,
e
.
getMessage
(),
e
);
}
return
;
}
String
relationKey
=
SecureUtil
.
md5
(
staffId
+
dto
.
getExternalUserid
());
WelcomeDetailBO
welcomeDetailBO
=
null
;
if
(
StringUtils
.
isNotBlank
(
state
)
&&
(
state
.
startsWith
(
Manage3Constants
.
HM
)
||
state
.
startsWith
(
Manage3Constants
.
DT
)))
{
//"HM+id" "DT+key"
log
.
info
(
"特殊欢迎语 state:{}"
,
state
);
WelcomeReferBO
welcomeReferBo
=
getWelcomeReferBo
(
state
);
welcomeDetailBO
=
welcomeService
.
getMatchWelcomeWithReferId
(
staffId
,
wxEnterpriseId
,
welcomeReferBo
);
}
else
{
welcomeDetailBO
=
welcomeService
.
getMatchWelcome
(
staffId
,
wxEnterpriseId
);
}
if
(
Objects
.
isNull
(
welcomeDetailBO
))
{
log
.
info
(
"欢迎语未配置:wxEnterpriseId:{}"
,
wxEnterpriseId
);
return
;
...
...
@@ -877,12 +876,25 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
}
qywxWelcomeMsgDTO
.
setWelcomeCode
(
welcomeCode
);
log
.
info
(
"[sendWelcome] 发送欢迎语 params:{}"
,
JSON
.
toJSONString
(
qywxWelcomeMsgDTO
));
String
result
=
null
;
if
(
dto
.
getSuiteid
().
equals
(
SELF_APP
))
{
//好办助手和代开发
SecretSettingDTO
secretSetting
=
secretSettingService
.
getSecretSetting
(
dto
.
getWxEnterpriseId
(),
SecretTypeEnum
.
CUSTOMIZED_APP
.
getVal
());
qywxUserApiService
.
sendSelfWelcomeMsgByExternal
(
dto
.
getCorpid
(),
secretSetting
.
getSecretVal
(),
qywxWelcomeMsgDTO
);
result
=
qywxUserApiService
.
sendSelfWelcomeMsgByExternal
(
dto
.
getCorpid
(),
secretSetting
.
getSecretVal
(),
qywxWelcomeMsgDTO
);
}
else
{
qywxUserApiService
.
sendWelcomeMsgByExternal
(
dto
.
getCorpid
(),
config
.
getWxSuiteid
(),
qywxWelcomeMsgDTO
);
result
=
qywxUserApiService
.
sendWelcomeMsgByExternal
(
dto
.
getCorpid
(),
config
.
getWxSuiteid
(),
qywxWelcomeMsgDTO
);
}
if
(
StringUtils
.
isNotBlank
(
result
))
{
JSONObject
json
=
JSON
.
parseObject
(
result
)
;
int
errcode
=
json
.
getIntValue
(
"errcode"
)
;
if
(
0
!=
errcode
)
{
try
{
errLog
.
setScenario
(
"欢迎语"
);
errLog
.
setErrorContent
(
result
);
clientInstance
.
sendMessage
(
Manage3Constants
.
QYWX_ERROR_MSG
,
JSON
.
toJSONString
(
errLog
));
}
catch
(
Exception
e
)
{
log
.
error
(
"发送消息失败:{}"
,
e
.
getMessage
(),
e
);
}
}
}
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/QywxErrorLogApiServiceImpl.java
View file @
19040ddd
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
out
.
impl
;
import
cn.hutool.core.date.DatePattern
;
import
cn.hutool.core.date.DateUtil
;
import
java.util.List
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.alibaba.fastjson.JSON
;
import
com.gic.api.base.commons.Page
;
import
com.gic.haoban.common.utils.EntityUtil
;
...
...
@@ -14,12 +17,9 @@ import com.gic.haoban.manage.service.pojo.bo.TabQywxErrorLogBO;
import
com.gic.haoban.manage.service.service.QywxErrorLogService
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
cn.hutool.core.date.DatePattern
;
import
cn.hutool.core.date.DateUtil
;
/**
* 企微报错日志(TabQywxErrorLog)表服务实现类
...
...
@@ -29,23 +29,16 @@ import java.util.List;
*/
@Service
public
class
QywxErrorLogApiServiceImpl
implements
QywxErrorLogApiService
{
private
static
final
Logger
log
=
LogManager
.
getLogger
(
QywxErrorLogApiServiceImpl
.
class
);
@Autowired
private
QywxErrorLogService
tabQywxErrorLogService
;
@Override
public
void
insertQywxErrorLog
(
String
param
)
{
log
.
info
(
"请求企微报错日志:{}"
,
param
);
QywxErrorLogDTO
qywxErrorLogDTO
=
JSON
.
parseObject
(
param
,
QywxErrorLogDTO
.
class
);
tabQywxErrorLogService
.
insert
(
EntityUtil
.
changeEntityByOrika
(
TabQywxErrorLogBO
.
class
,
qywxErrorLogDTO
));
}
@Override
public
QywxErrorLogDTO
queryById
(
Long
id
)
{
return
EntityUtil
.
changeEntityByOrika
(
QywxErrorLogDTO
.
class
,
tabQywxErrorLogService
.
queryById
(
id
));
}
@Override
public
Page
<
QywxErrorLogDTO
>
queryListByPage
(
QywxErrorLogListQDTO
qywxErrorLogListQDTO
)
{
qywxErrorLogListQDTO
.
setStartDate
(
DateUtil
.
format
(
DateUtil
.
beginOfDay
(
DateUtil
.
parse
(
qywxErrorLogListQDTO
.
getStartDate
())),
DatePattern
.
NORM_DATETIME_PATTERN
));
qywxErrorLogListQDTO
.
setEndDate
(
DateUtil
.
format
(
DateUtil
.
beginOfDay
(
DateUtil
.
parse
(
qywxErrorLogListQDTO
.
getEndDate
())),
DatePattern
.
NORM_DATETIME_PATTERN
));
...
...
haoban-manage3-service/src/main/resources/mapper/TabQywxErrorLogMapper.xml
View file @
19040ddd
...
...
@@ -3,19 +3,20 @@
<mapper
namespace=
"com.gic.haoban.manage.service.dao.mapper.TabQywxErrorLogMapper"
>
<resultMap
type=
"com.gic.haoban.manage.service.entity.TabQywxErrorLog"
id=
"TabQywxErrorLogMap"
>
<result
property=
"id"
column=
"id"
jdbcType=
"INTEGER"
/>
<result
property=
"wxEnterpriseId"
column=
"wx_enterprise_id"
jdbcType=
"VARCHAR"
/>
<result
property=
"
corpid"
column=
"corpid"
jdbcType=
"VARCHAR
"
/>
<result
property=
"
qywxInterface"
column=
"qywx_interface"
jdbcType=
"VARCHAR"
/>
<result
property=
"scenario"
column=
"scenario"
jdbcType=
"VARCHAR"
/>
<result
property=
"errorContent"
column=
"error_content"
jdbcType=
"VARCHAR"
/>
<result
property=
"weworkErrorUrl"
column=
"wework_error_url"
jdbcType=
"VARCHAR"
/>
<result
property=
"traceId"
column=
"trace_id"
jdbcType=
"VARCHAR"
/>
<result
property=
"qywxErrorType"
column=
"qywx_error_type"
jdbcType=
"INTEGER"
/>
<result
property=
"createTime"
column=
"create_time"
jdbcType=
"TIMESTAMP"
/>
<result
property=
"id"
column=
"id"
/>
<result
property=
"wxEnterpriseId"
column=
"wx_enterprise_id"
/>
<result
property=
"
member_id"
column=
"memberId
"
/>
<result
property=
"
external_user_id"
column=
"externalUserId"
/>
<result
property=
"scenario"
column=
"scenario"
/>
<result
property=
"errorContent"
column=
"error_content"
/>
<result
property=
"weworkErrorUrl"
column=
"wework_error_url"
/>
<result
property=
"traceId"
column=
"trace_id"
/>
<result
property=
"qywxErrorType"
column=
"qywx_error_type"
/>
<result
property=
"createTime"
column=
"create_time"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, wx_enterprise_id,corpid,qywx_interface,scenario, error_content, wework_error_url, trace_id, qywx_error_type, create_time
</sql>
id, wx_enterprise_id, member_id , external_user_id ,scenario, error_content, trace_id, qywx_error_type, create_time
</sql>
<!--新增所有列-->
<insert
id=
"insert"
keyProperty=
"id"
useGeneratedKeys=
"true"
...
...
@@ -28,11 +29,11 @@
<if
test=
"wxEnterpriseId != null and wxEnterpriseId != ''"
>
wx_enterprise_id,
</if>
<if
test=
"
corpid != null and corpi
d != ''"
>
corp
id,
<if
test=
"
memberId != null and memberI
d != ''"
>
member_
id,
</if>
<if
test=
"
qywxInterface != null and qywxInterface
!= ''"
>
qywx_interface
,
<if
test=
"
externalUserId != null and externalUserId
!= ''"
>
external_user_id
,
</if>
<if
test=
"scenario != null and scenario != ''"
>
scenario,
...
...
@@ -40,9 +41,6 @@
<if
test=
"errorContent != null and errorContent != ''"
>
error_content,
</if>
<if
test=
"weworkErrorUrl != null and weworkErrorUrl != ''"
>
wework_error_url,
</if>
<if
test=
"traceId != null and traceId != ''"
>
trace_id,
</if>
...
...
@@ -60,11 +58,11 @@
<if
test=
"wxEnterpriseId != null and wxEnterpriseId != ''"
>
#{wxEnterpriseId},
</if>
<if
test=
"
corpid != null and corpi
d != ''"
>
#{
corpi
d},
<if
test=
"
memberId != null and memberI
d != ''"
>
#{
memberI
d},
</if>
<if
test=
"
qywxInterface != null and qywxInterface
!= ''"
>
#{
qywxInterface
},
<if
test=
"
externalUserId != null and externalUserId
!= ''"
>
#{
externalUserId
},
</if>
<if
test=
"scenario != null and scenario != ''"
>
#{scenario},
...
...
@@ -72,9 +70,6 @@
<if
test=
"errorContent != null and errorContent != ''"
>
#{errorContent},
</if>
<if
test=
"weworkErrorUrl != null and weworkErrorUrl != ''"
>
#{weworkErrorUrl},
</if>
<if
test=
"traceId != null and traceId != ''"
>
#{traceId},
</if>
...
...
@@ -88,14 +83,6 @@
</insert>
<!--查询单个-->
<select
id=
"queryById"
resultMap=
"TabQywxErrorLogMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_qywx_error_log
where id = #{id}
</select>
<!--通过实体作为筛选条件查询-->
<select
id=
"queryListByPage"
parameterType=
"com.gic.haoban.manage.api.dto.qdto.QywxErrorLogListQDTO"
resultMap=
"TabQywxErrorLogMap"
>
...
...
@@ -109,6 +96,12 @@
<if
test=
"scenario != null and scenario != ''"
>
and scenario like CONCAT('%',#{scenario},'%')
</if>
<if
test=
"memberId != null and memberId != ''"
>
and member_id = #{memberId}
</if>
<if
test=
"externalUserId != null and externalUserId != ''"
>
and external_user_id = #{externalUserId}
</if>
<if
test=
"qywxErrorType != null"
>
and qywx_error_type = #{qywxErrorType}
</if>
...
...
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