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
860f0cba
Commit
860f0cba
authored
Apr 19, 2022
by
墨竹
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:新增企微报错列表
parent
39a56a98
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
151 additions
and
17 deletions
+151
-17
Manage3Constants.java
...com/gic/haoban/manage/api/constants/Manage3Constants.java
+12
-0
QywxErrorLogDTO.java
...n/java/com/gic/haoban/manage/api/dto/QywxErrorLogDTO.java
+18
-0
QywxErrorLogListQDTO.java
.../gic/haoban/manage/api/dto/qdto/QywxErrorLogListQDTO.java
+18
-8
TabQywxErrorLog.java
...com/gic/haoban/manage/service/entity/TabQywxErrorLog.java
+18
-0
TabQywxErrorLogBO.java
.../gic/haoban/manage/service/pojo/bo/TabQywxErrorLogBO.java
+18
-0
TabQywxErrorLogServiceImpl.java
...nage/service/service/impl/TabQywxErrorLogServiceImpl.java
+19
-4
MemberUnionidRelatedApiServiceImpl.java
.../service/out/impl/MemberUnionidRelatedApiServiceImpl.java
+24
-4
TabQywxErrorLogMapper.xml
...rvice/src/main/resources/mapper/TabQywxErrorLogMapper.xml
+24
-1
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/constants/Manage3Constants.java
0 → 100644
View file @
860f0cba
package
com
.
gic
.
haoban
.
manage
.
api
.
constants
;
/**
* @author mozhu
* @date 2022/4/19 15:12
*/
public
class
Manage3Constants
{
/**
* 企业微信报错日志消息路由
*/
public
static
final
String
QYWX_ERROR_MSG
=
"qywxErrorLogMq"
;
}
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/QywxErrorLogDTO.java
View file @
860f0cba
...
...
@@ -13,6 +13,8 @@ public class QywxErrorLogDTO implements Serializable {
private
static
final
long
serialVersionUID
=
-
2297821152064066567L
;
private
Long
id
;
private
String
wxEnterpriseId
;
private
String
corpid
;
private
String
scenario
;
private
String
errorContent
;
private
String
weworkErrorUrl
;
...
...
@@ -28,6 +30,22 @@ public class QywxErrorLogDTO implements Serializable {
this
.
id
=
id
;
}
public
String
getWxEnterpriseId
()
{
return
wxEnterpriseId
;
}
public
void
setWxEnterpriseId
(
String
wxEnterpriseId
)
{
this
.
wxEnterpriseId
=
wxEnterpriseId
;
}
public
String
getCorpid
()
{
return
corpid
;
}
public
void
setCorpid
(
String
corpid
)
{
this
.
corpid
=
corpid
;
}
public
String
getScenario
()
{
return
scenario
;
}
...
...
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/qdto/QywxErrorLogListQDTO.java
View file @
860f0cba
...
...
@@ -14,6 +14,10 @@ public class QywxErrorLogListQDTO extends BasePageInfo implements Serializable {
* 场景
*/
private
String
scenario
;
private
String
wxEnterpriseId
;
private
String
corpid
;
/**
* 1:好办后台;2:好办小程序;3:会员小程序
*/
...
...
@@ -54,13 +58,19 @@ public class QywxErrorLogListQDTO extends BasePageInfo implements Serializable {
this
.
endDate
=
endDate
;
}
@Override
public
String
toString
()
{
return
"QywxErrorLogListQDTO{"
+
"scenario='"
+
scenario
+
'\''
+
", qywxErrorType="
+
qywxErrorType
+
", startDate='"
+
startDate
+
'\''
+
", endDate='"
+
endDate
+
'\''
+
'}'
;
public
String
getWxEnterpriseId
()
{
return
wxEnterpriseId
;
}
public
void
setWxEnterpriseId
(
String
wxEnterpriseId
)
{
this
.
wxEnterpriseId
=
wxEnterpriseId
;
}
public
String
getCorpid
()
{
return
corpid
;
}
public
void
setCorpid
(
String
corpid
)
{
this
.
corpid
=
corpid
;
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/entity/TabQywxErrorLog.java
View file @
860f0cba
...
...
@@ -16,6 +16,8 @@ public class TabQywxErrorLog implements Serializable {
private
static
final
long
serialVersionUID
=
-
2508513770725265072L
;
private
Long
id
;
private
String
wxEnterpriseId
;
private
String
corpid
;
/**
* 场景
*/
...
...
@@ -47,6 +49,22 @@ public class TabQywxErrorLog implements Serializable {
this
.
id
=
id
;
}
public
String
getWxEnterpriseId
()
{
return
wxEnterpriseId
;
}
public
void
setWxEnterpriseId
(
String
wxEnterpriseId
)
{
this
.
wxEnterpriseId
=
wxEnterpriseId
;
}
public
String
getCorpid
()
{
return
corpid
;
}
public
void
setCorpid
(
String
corpid
)
{
this
.
corpid
=
corpid
;
}
public
String
getScenario
()
{
return
scenario
;
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/pojo/bo/TabQywxErrorLogBO.java
View file @
860f0cba
...
...
@@ -13,6 +13,8 @@ public class TabQywxErrorLogBO implements Serializable {
private
static
final
long
serialVersionUID
=
-
2297821152064066567L
;
private
Long
id
;
private
String
wxEnterpriseId
;
private
String
corpid
;
private
String
scenario
;
private
String
errorContent
;
private
String
weworkErrorUrl
;
...
...
@@ -28,6 +30,22 @@ public class TabQywxErrorLogBO implements Serializable {
this
.
id
=
id
;
}
public
String
getWxEnterpriseId
()
{
return
wxEnterpriseId
;
}
public
void
setWxEnterpriseId
(
String
wxEnterpriseId
)
{
this
.
wxEnterpriseId
=
wxEnterpriseId
;
}
public
String
getCorpid
()
{
return
corpid
;
}
public
void
setCorpid
(
String
corpid
)
{
this
.
corpid
=
corpid
;
}
public
String
getScenario
()
{
return
scenario
;
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/TabQywxErrorLogServiceImpl.java
View file @
860f0cba
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
impl
;
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.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -24,13 +28,24 @@ public class TabQywxErrorLogServiceImpl implements QywxErrorLogService {
@Autowired
private
TabQywxErrorLogMapper
tabQywxErrorLogMapper
;
@Autowired
private
WxApplicationService
wxApplicationService
;
@Override
public
TabQywxErrorLogBO
insert
(
TabQywxErrorLogBO
tabQywxErrorLogBO
)
{
TabQywxErrorLog
tabQywxErrorLog
=
new
TabQywxErrorLog
();
BeanUtils
.
copyProperties
(
tabQywxErrorLogBO
,
tabQywxErrorLog
);
tabQywxErrorLogBO
.
setCreateTime
(
new
Date
());
BeanUtils
.
copyProperties
(
tabQywxErrorLogBO
,
tabQywxErrorLog
);
String
wxEnterpriseId
=
tabQywxErrorLogBO
.
getWxEnterpriseId
();
String
corpid
=
tabQywxErrorLogBO
.
getCorpid
();
if
(
StringUtils
.
isBlank
(
wxEnterpriseId
))
{
TabHaobanWxApplication
tabHaobanWxApplication
=
wxApplicationService
.
selectByCorpId
(
corpid
);
if
(
tabHaobanWxApplication
!=
null
)
{
tabQywxErrorLog
.
setWxEnterpriseId
(
tabHaobanWxApplication
.
getWxEnterpriseId
());
}
}
tabQywxErrorLog
.
setId
(
UniqueIdUtils
.
uniqueLong
());
tabQywxErrorLog
.
setCreateTime
(
new
Date
());
this
.
tabQywxErrorLogMapper
.
insert
(
tabQywxErrorLog
);
return
tabQywxErrorLogBO
;
}
...
...
@@ -38,12 +53,12 @@ public class TabQywxErrorLogServiceImpl implements QywxErrorLogService {
@Override
public
TabQywxErrorLogBO
queryById
(
Long
id
)
{
TabQywxErrorLog
tabQywxErrorLog
=
this
.
tabQywxErrorLogMapper
.
queryById
(
id
);
return
EntityUtil
.
changeEntityByOrika
(
TabQywxErrorLogBO
.
class
,
tabQywxErrorLog
);
return
EntityUtil
.
changeEntityByOrika
(
TabQywxErrorLogBO
.
class
,
tabQywxErrorLog
);
}
@Override
public
List
<
TabQywxErrorLogBO
>
queryListByPage
(
QywxErrorLogListQDTO
qywxErrorLogListQDTO
)
{
return
EntityUtil
.
changeEntityListByOrika
(
TabQywxErrorLogBO
.
class
,
this
.
tabQywxErrorLogMapper
.
queryListByPage
(
qywxErrorLogListQDTO
));
return
EntityUtil
.
changeEntityListByOrika
(
TabQywxErrorLogBO
.
class
,
this
.
tabQywxErrorLogMapper
.
queryListByPage
(
qywxErrorLogListQDTO
));
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/MemberUnionidRelatedApiServiceImpl.java
View file @
860f0cba
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
out
.
impl
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.convert.Convert
;
import
cn.hutool.crypto.SecureUtil
;
...
...
@@ -15,6 +14,7 @@ import com.gic.clerk.api.service.PowerService;
import
com.gic.commons.util.DateUtil
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.GICMQClientUtil
;
import
com.gic.dubbo.entity.ProviderLocalTag
;
import
com.gic.enterprise.api.dto.QRcodeDTO
;
import
com.gic.enterprise.api.dto.StoreDTO
;
import
com.gic.enterprise.api.service.ImageService
;
...
...
@@ -29,6 +29,7 @@ import com.gic.haoban.app.customer.service.api.service.CustomerApiService;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.common.utils.PageUtil
;
import
com.gic.haoban.manage.api.constants.Manage3Constants
;
import
com.gic.haoban.manage.api.dto.*
;
import
com.gic.haoban.manage.api.enums.SecretTypeEnum
;
import
com.gic.haoban.manage.api.enums.WelcomeMediaTypeEnum
;
...
...
@@ -45,6 +46,7 @@ import com.gic.haoban.manage.service.exception.WxApiLimitException;
import
com.gic.haoban.manage.service.pojo.DealQywxExternalUserPojo
;
import
com.gic.haoban.manage.service.pojo.ExternalUserPojo
;
import
com.gic.haoban.manage.service.pojo.QywxTagSyncInfoPojo
;
import
com.gic.haoban.manage.service.pojo.bo.TabQywxErrorLogBO
;
import
com.gic.haoban.manage.service.pojo.bo.welcome.WelcomeDetailBO
;
import
com.gic.haoban.manage.service.pojo.bo.welcome.WelcomeMediaBO
;
import
com.gic.haoban.manage.service.service.*
;
...
...
@@ -293,7 +295,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
String
unionid
=
dto
.
getUnionid
();
log
.
info
(
"新增外部联系人,wxEnterpriseId:{}"
,
wxEnterpriseId
);
if
(
StringUtils
.
isAnyBlank
(
wxUserId
,
wxEnterpriseId
,
name
,
createTime
,
externalUserId
))
{
log
.
error
(
"新增外部联系人,缺少必须字段:wxUserId:{},wxEnterpriseId:{},name:{},createTime:{},externalUserId:{}"
,
wxUserId
,
wxEnterpriseId
,
name
,
createTime
,
externalUserId
);
log
.
error
(
"新增外部联系人,缺少必须字段:wxUserId:{},wxEnterpriseId:{},name:{},createTime:{},externalUserId:{}"
,
wxUserId
,
wxEnterpriseId
,
name
,
createTime
,
externalUserId
);
//checkQywxSettingApiService.saveFriendCallback(wxEnterpriseId,null, dto);
return
;
}
...
...
@@ -499,6 +501,24 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
*/
private
void
sendWelcome
(
MemberUnionidRelatedDTO
dto
,
String
wxEnterpriseId
,
String
enterpriseId
,
String
staffId
,
String
clerkId
)
{
log
.
info
(
"发送欢迎语:dto:{},wxEnterpriseId:{},staffId:{}"
,
JSONObject
.
toJSONString
(
dto
),
wxEnterpriseId
,
staffId
);
String
welcomeCode
=
dto
.
getWelcomeCode
();
if
(
StringUtils
.
isBlank
(
welcomeCode
))
{
log
.
error
(
"welcomeCode为空,请检查是否使用企微的欢迎语:{}"
,
wxEnterpriseId
);
GicMQClient
clientInstance
=
GICMQClientUtil
.
getClientInstance
();
try
{
TabQywxErrorLogBO
qywxErrorLogBO
=
new
TabQywxErrorLogBO
();
qywxErrorLogBO
.
setWxEnterpriseId
(
wxEnterpriseId
);
qywxErrorLogBO
.
setCorpid
(
dto
.
getCorpid
());
qywxErrorLogBO
.
setScenario
(
"欢迎语不发送"
);
qywxErrorLogBO
.
setErrorContent
(
"welcomeCode为空,请检查是否使用企微的欢迎语"
);
qywxErrorLogBO
.
setTraceId
(
ProviderLocalTag
.
tag
.
get
().
traceId
);
qywxErrorLogBO
.
setQywxErrorType
(
1
);
clientInstance
.
sendMessage
(
Manage3Constants
.
QYWX_ERROR_MSG
,
JSON
.
toJSONString
(
qywxErrorLogBO
));
}
catch
(
Exception
e
)
{
log
.
error
(
"发送消息失败:{}"
,
e
.
getMessage
(),
e
);
}
return
;
}
String
relationKey
=
SecureUtil
.
md5
(
staffId
+
dto
.
getExternalUserid
());
WelcomeDetailBO
welcomeDetailBO
=
welcomeService
.
getMatchWelcome
(
staffId
,
wxEnterpriseId
);
if
(
Objects
.
isNull
(
welcomeDetailBO
))
{
...
...
@@ -547,7 +567,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
if
(
CollectionUtils
.
isNotEmpty
(
attachments
))
{
qywxWelcomeMsgDTO
.
setAttachments
(
attachments
);
}
qywxWelcomeMsgDTO
.
setWelcomeCode
(
dto
.
getWelcomeCode
()
);
qywxWelcomeMsgDTO
.
setWelcomeCode
(
welcomeCode
);
if
(
dto
.
getSuiteid
().
equals
(
SELF_APP
))
{
//好办助手和代开发
SecretSettingDTO
secretSetting
=
secretSettingService
.
getSecretSetting
(
dto
.
getWxEnterpriseId
(),
SecretTypeEnum
.
HAOBAN_HELP
.
getVal
());
...
...
@@ -1939,7 +1959,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
@Override
public
MemberUnionidRelatedDTO
getById
(
String
memberUnionidRelatedId
)
{
MemberUnionidRelated
memberUnionidRelated
=
memberUnionidRelatedMapper
.
selectByPrimaryKey
(
memberUnionidRelatedId
);
return
EntityUtil
.
changeEntityNew
(
MemberUnionidRelatedDTO
.
class
,
memberUnionidRelated
);
return
EntityUtil
.
changeEntityNew
(
MemberUnionidRelatedDTO
.
class
,
memberUnionidRelated
);
}
/**
...
...
haoban-manage3-service/src/main/resources/mapper/TabQywxErrorLogMapper.xml
View file @
860f0cba
...
...
@@ -4,6 +4,8 @@
<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=
"scenario"
column=
"scenario"
jdbcType=
"VARCHAR"
/>
<result
property=
"errorContent"
column=
"error_content"
jdbcType=
"VARCHAR"
/>
<result
property=
"weworkErrorUrl"
column=
"wework_error_url"
jdbcType=
"VARCHAR"
/>
...
...
@@ -12,7 +14,7 @@
<result
property=
"createTime"
column=
"create_time"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, scenario, error_content, wework_error_url, trace_id, qywx_error_type, create_time
</sql>
id,
wx_enterprise_id,corpid,
scenario, error_content, wework_error_url, trace_id, qywx_error_type, create_time
</sql>
<!--新增所有列-->
<insert
id=
"insert"
keyProperty=
"id"
useGeneratedKeys=
"true"
parameterType=
"com.gic.haoban.manage.service.entity.TabQywxErrorLog"
>
...
...
@@ -21,6 +23,12 @@
<if
test=
"id != null"
>
id,
</if>
<if
test=
"wxEnterpriseId != null and wxEnterpriseId != ''"
>
wx_enterprise_id,
</if>
<if
test=
"corpid != null and corpid != ''"
>
corpid,
</if>
<if
test=
"scenario != null and scenario != ''"
>
scenario,
</if>
...
...
@@ -44,6 +52,12 @@
<if
test=
"id != null"
>
#{id},
</if>
<if
test=
"wxEnterpriseId != null and wxEnterpriseId != ''"
>
#{wxEnterpriseId},
</if>
<if
test=
"corpid != null and corpid != ''"
>
#{corpid},
</if>
<if
test=
"scenario != null and scenario != ''"
>
#{scenario},
</if>
...
...
@@ -69,6 +83,12 @@
<update
id=
"update"
parameterType=
"com.gic.haoban.manage.service.entity.TabQywxErrorLog"
>
update tab_qywx_error_log
<set>
<if
test=
"wxEnterpriseId != null and wxEnterpriseId != ''"
>
wx_enterprise_id = #{wxEnterpriseId},
</if>
<if
test=
"corpid != null and corpid != ''"
>
corpid = #{corpid},
</if>
<if
test=
"scenario != null and scenario != ''"
>
scenario = #{scenario},
</if>
...
...
@@ -112,6 +132,9 @@
<include
refid=
"Base_Column_List"
/>
from tab_qywx_error_log
<where>
<if
test=
"wxEnterpriseId != null and wxEnterpriseId != ''"
>
and wx_enterprise_id = #{wxEnterpriseId}
</if>
<if
test=
"scenario != null and scenario != ''"
>
and scenario = #{scenario}
</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