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
d24f80b6
Commit
d24f80b6
authored
Jul 13, 2022
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
停用好办
parent
4aa574a1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
83 additions
and
11 deletions
+83
-11
WxEnterpriseApiService.java
...gic/haoban/manage/api/service/WxEnterpriseApiService.java
+10
-1
WxEnterpriseRelatedMapper.java
.../manage/service/dao/mapper/WxEnterpriseRelatedMapper.java
+6
-3
WxEnterpriseService.java
...ic/haoban/manage/service/service/WxEnterpriseService.java
+2
-0
WxEnterpriseServiceImpl.java
.../manage/service/service/impl/WxEnterpriseServiceImpl.java
+54
-6
WxEnterpriseApiServiceImpl.java
.../service/service/out/impl/WxEnterpriseApiServiceImpl.java
+5
-0
WxEnterpriseRelatedMapper.xml
...e/src/main/resources/mapper/WxEnterpriseRelatedMapper.xml
+6
-1
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/WxEnterpriseApiService.java
View file @
d24f80b6
package
com
.
gic
.
haoban
.
manage
.
api
.
service
;
package
com
.
gic
.
haoban
.
manage
.
api
.
service
;
import
com.gic.api.base.commons.Page
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.manage.api.dto.*
;
import
com.gic.haoban.manage.api.dto.*
;
...
@@ -214,5 +213,15 @@ public interface WxEnterpriseApiService {
...
@@ -214,5 +213,15 @@ public interface WxEnterpriseApiService {
* @date 2022-06-27 13:44:16
* @date 2022-06-27 13:44:16
*/
*/
SecretSettingDTO
getSecretSettingById
(
String
secretId
);
SecretSettingDTO
getSecretSettingById
(
String
secretId
);
/**
*
* @Title: stopHaoban
* @Description: 停用好办
* @author xugh
* @param enterpriseId
* @throws
*/
void
stopHaoban
(
String
enterpriseId
)
;
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/WxEnterpriseRelatedMapper.java
View file @
d24f80b6
package
com
.
gic
.
haoban
.
manage
.
service
.
dao
.
mapper
;
package
com
.
gic
.
haoban
.
manage
.
service
.
dao
.
mapper
;
import
com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseRelated
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseRelated
;
public
interface
WxEnterpriseRelatedMapper
{
public
interface
WxEnterpriseRelatedMapper
{
int
deleteByPrimaryKey
(
String
wxEnterpriseRelatedId
);
int
deleteByPrimaryKey
(
String
wxEnterpriseRelatedId
);
int
deleteByEnterpriseId
(
String
enterpriseId
)
;
int
insertSelective
(
TabHaobanWxEnterpriseRelated
record
);
int
insertSelective
(
TabHaobanWxEnterpriseRelated
record
);
...
@@ -19,7 +22,7 @@ public interface WxEnterpriseRelatedMapper {
...
@@ -19,7 +22,7 @@ public interface WxEnterpriseRelatedMapper {
List
<
TabHaobanWxEnterpriseRelated
>
listByWxenterpriseIdList
(
@Param
(
"wxEnterpriseIdList"
)
List
<
String
>
wxEnterpriseIdList
);
List
<
TabHaobanWxEnterpriseRelated
>
listByWxenterpriseIdList
(
@Param
(
"wxEnterpriseIdList"
)
List
<
String
>
wxEnterpriseIdList
);
TabHaobanWxEnterpriseRelated
findOne
ByEnterpriseId
(
String
enterpriseId
);
List
<
TabHaobanWxEnterpriseRelated
>
list
ByEnterpriseId
(
String
enterpriseId
);
List
<
TabHaobanWxEnterpriseRelated
>
queryAllHasGicEnterpriseId
();
List
<
TabHaobanWxEnterpriseRelated
>
queryAllHasGicEnterpriseId
();
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/WxEnterpriseService.java
View file @
d24f80b6
...
@@ -53,4 +53,6 @@ public interface WxEnterpriseService {
...
@@ -53,4 +53,6 @@ public interface WxEnterpriseService {
* @return
* @return
*/
*/
List
<
TabHaobanWxEnterprise
>
listAll
();
List
<
TabHaobanWxEnterprise
>
listAll
();
void
stopHaoban
(
String
enterpriseId
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/WxEnterpriseServiceImpl.java
View file @
d24f80b6
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
impl
;
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
impl
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.alibaba.fastjson.JSON
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.haoban.common.utils.DingUtils
;
import
com.gic.haoban.common.utils.StringUtil
;
import
com.gic.haoban.common.utils.StringUtil
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseDTO
;
import
com.gic.haoban.manage.service.dao.mapper.WxEnterpriseMapper
;
import
com.gic.haoban.manage.service.dao.mapper.WxEnterpriseMapper
;
import
com.gic.haoban.manage.service.dao.mapper.WxEnterpriseRelatedMapper
;
import
com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise
;
import
com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise
;
import
com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseRelated
;
import
com.gic.haoban.manage.service.service.WxEnterpriseService
;
import
com.gic.haoban.manage.service.service.WxEnterpriseService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
import
java.util.List
;
@Service
@Service
public
class
WxEnterpriseServiceImpl
implements
WxEnterpriseService
{
public
class
WxEnterpriseServiceImpl
implements
WxEnterpriseService
{
private
static
org
.
apache
.
logging
.
log4j
.
Logger
logger
=
LogManager
.
getLogger
(
WxEnterpriseService
.
class
);
@Autowired
@Autowired
private
WxEnterpriseMapper
mapper
;
private
WxEnterpriseMapper
mapper
;
@Autowired
private
WxEnterpriseRelatedMapper
wxEnterpriseRelatedMapper
;
@Override
@Override
public
String
add
(
WxEnterpriseDTO
wxDTO
)
{
public
String
add
(
WxEnterpriseDTO
wxDTO
)
{
...
@@ -94,4 +107,39 @@ public class WxEnterpriseServiceImpl implements WxEnterpriseService {
...
@@ -94,4 +107,39 @@ public class WxEnterpriseServiceImpl implements WxEnterpriseService {
public
List
<
TabHaobanWxEnterprise
>
listAll
()
{
public
List
<
TabHaobanWxEnterprise
>
listAll
()
{
return
mapper
.
listAll
();
return
mapper
.
listAll
();
}
}
@Override
public
void
stopHaoban
(
String
enterpriseId
)
{
List
<
TabHaobanWxEnterpriseRelated
>
list
=
this
.
wxEnterpriseRelatedMapper
.
listByEnterpriseId
(
enterpriseId
)
;
logger
.
info
(
"停用好办={},list={}"
,
enterpriseId
,
JSON
.
toJSONString
(
list
));
List
<
String
>
wxEnterpriseIdList
=
new
ArrayList
<>();
for
(
TabHaobanWxEnterpriseRelated
item
:
list
)
{
String
wxEnterpriseId
=
item
.
getWxEnterpriseId
()
;
wxEnterpriseIdList
.
add
(
wxEnterpriseId
)
;
}
this
.
wxEnterpriseRelatedMapper
.
deleteByEnterpriseId
(
enterpriseId
)
;
Map
<
String
,
Object
>
enMap
=
new
HashMap
<>();
enMap
.
put
(
"enterpriseId"
,
enterpriseId
)
;
alert
(
"删除商户企微关联告警"
,
enMap
);
for
(
String
wxEnterpriseId
:
wxEnterpriseIdList
)
{
List
<
TabHaobanWxEnterpriseRelated
>
relationList
=
this
.
wxEnterpriseRelatedMapper
.
listByWxenterpriseId
(
wxEnterpriseId
)
;
if
(
CollectionUtils
.
isEmpty
(
relationList
))
{
// 停用企微
TabHaobanWxEnterprise
tab
=
new
TabHaobanWxEnterprise
()
;
tab
.
setWxEnterpriseId
(
wxEnterpriseId
);
tab
.
setStatusFlag
(
0
);
tab
.
setUpdateTime
(
new
Date
());
this
.
mapper
.
updateByPrimaryKeySelective
(
tab
)
;
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"wxEnterpriseId"
,
wxEnterpriseId
)
;
alert
(
"删除企微告警"
,
map
);
}
}
}
private
void
alert
(
String
title
,
Map
<
String
,
Object
>
map
)
{
String
msg
=
title
+
JSON
.
toJSONString
(
map
);
String
dingUrl
=
"https://oapi.dingtalk.com/robot/send?access_token=c38fdc53d26e9a019640755bdada1ce07ebd44a2555d1c8acc299de7a7b5b857"
;
DingUtils
.
send
(
msg
,
dingUrl
,
true
);
}
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/WxEnterpriseApiServiceImpl.java
View file @
d24f80b6
...
@@ -370,4 +370,9 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService {
...
@@ -370,4 +370,9 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService {
public
SecretSettingDTO
getSecretSettingById
(
String
secretId
)
{
public
SecretSettingDTO
getSecretSettingById
(
String
secretId
)
{
return
secretSettingService
.
getSecretSettingById
(
secretId
);
return
secretSettingService
.
getSecretSettingById
(
secretId
);
}
}
@Override
public
void
stopHaoban
(
String
enterpriseId
)
{
this
.
wxEnterpriseService
.
stopHaoban
(
enterpriseId
)
;
}
}
}
haoban-manage3-service/src/main/resources/mapper/WxEnterpriseRelatedMapper.xml
View file @
d24f80b6
...
@@ -32,6 +32,11 @@
...
@@ -32,6 +32,11 @@
from tab_haoban_wx_enterprise_related
from tab_haoban_wx_enterprise_related
where wx_enterprise_related_id = #{wxEnterpriseRelatedId,jdbcType=VARCHAR}
where wx_enterprise_related_id = #{wxEnterpriseRelatedId,jdbcType=VARCHAR}
</delete>
</delete>
<update
id=
"deleteByEnterpriseId"
>
update tab_haoban_wx_enterprise_related set status_flag = 0 , update_time=now() where enterprise_id=#{enterpriseId} and status_flag=1
</update>
<insert
id=
"insertSelective"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseRelated"
>
<insert
id=
"insertSelective"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseRelated"
>
insert into tab_haoban_wx_enterprise_related
insert into tab_haoban_wx_enterprise_related
...
@@ -185,7 +190,7 @@
...
@@ -185,7 +190,7 @@
and status_flag = 1
and status_flag = 1
</select>
</select>
<select
id=
"
findOne
ByEnterpriseId"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
<select
id=
"
list
ByEnterpriseId"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
select
<include
refid=
"Base_Column_List"
/>
<include
refid=
"Base_Column_List"
/>
from tab_haoban_wx_enterprise_related
from tab_haoban_wx_enterprise_related
...
...
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