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
c68eb1d2
Commit
c68eb1d2
authored
Feb 20, 2020
by
陶光胜
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' of
http://115.159.76.241/haoban3.0/haoban-manage3.0
into developer
parents
24e87b5e
f04e93e7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
147 additions
and
11 deletions
+147
-11
WxApplicationMapper.java
...haoban/manage/service/dao/mapper/WxApplicationMapper.java
+7
-0
WxApplicationService.java
...c/haoban/manage/service/service/WxApplicationService.java
+15
-0
WxApplicationServiceImpl.java
...manage/service/service/impl/WxApplicationServiceImpl.java
+49
-0
DepartmentApiServiceImpl.java
...ge/service/service/out/impl/DepartmentApiServiceImpl.java
+24
-9
WxEnterpriseApiServiceImpl.java
.../service/service/out/impl/WxEnterpriseApiServiceImpl.java
+32
-1
WxApplicationMapper.xml
...service/src/main/resources/mapper/WxApplicationMapper.xml
+19
-0
DepartmentContoller.java
...gic/haoban/manage/web/controller/DepartmentContoller.java
+1
-1
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/WxApplicationMapper.java
View file @
c68eb1d2
package
com
.
gic
.
haoban
.
manage
.
service
.
dao
.
mapper
;
import
org.apache.ibatis.annotations.Param
;
import
com.gic.haoban.manage.service.entity.TabHaobanWxApplication
;
public
interface
WxApplicationMapper
{
...
...
@@ -14,4 +16,8 @@ public interface WxApplicationMapper {
int
updateByPrimaryKeySelective
(
TabHaobanWxApplication
record
);
int
updateByPrimaryKey
(
TabHaobanWxApplication
record
);
TabHaobanWxApplication
selectBySiteIdAndWxEnterpriseId
(
@Param
(
"siteId"
)
String
siteId
,
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
);
TabHaobanWxApplication
selectByWxEnterpriseIdAndApplicationType
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
,
@Param
(
"applicationType"
)
int
applicationType
);
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/WxApplicationService.java
0 → 100644
View file @
c68eb1d2
package
com
.
gic
.
haoban
.
manage
.
service
.
service
;
import
com.gic.haoban.manage.service.entity.TabHaobanWxApplication
;
public
interface
WxApplicationService
{
TabHaobanWxApplication
selectBySiteIdAndWxEnterpriseId
(
String
siteId
,
String
wxEnterpriseId
);
void
insert
(
TabHaobanWxApplication
tab
);
void
update
(
TabHaobanWxApplication
tab
);
TabHaobanWxApplication
selectByWxEnterpriseIdAndApplicationType
(
String
wxEnterpriseId
,
int
applicationType
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/WxApplicationServiceImpl.java
0 → 100644
View file @
c68eb1d2
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
impl
;
import
java.util.Date
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.gic.haoban.common.utils.StringUtil
;
import
com.gic.haoban.manage.service.dao.mapper.WxApplicationMapper
;
import
com.gic.haoban.manage.service.entity.TabHaobanWxApplication
;
import
com.gic.haoban.manage.service.service.WxApplicationService
;
@Service
public
class
WxApplicationServiceImpl
implements
WxApplicationService
{
@Autowired
private
WxApplicationMapper
mapper
;
@Override
public
TabHaobanWxApplication
selectBySiteIdAndWxEnterpriseId
(
String
siteId
,
String
wxEnterpriseId
)
{
return
mapper
.
selectBySiteIdAndWxEnterpriseId
(
siteId
,
wxEnterpriseId
);
}
@Override
public
void
insert
(
TabHaobanWxApplication
tab
)
{
Date
now
=
new
Date
();
tab
.
setCreateTime
(
now
);
tab
.
setUpdateTime
(
now
);
tab
.
setStatusFlag
(
1
);
tab
.
setWxApplicationId
(
StringUtil
.
randomUUID
());
mapper
.
insertSelective
(
tab
);
}
@Override
public
void
update
(
TabHaobanWxApplication
tab
)
{
tab
.
setUpdateTime
(
new
Date
());
mapper
.
updateByPrimaryKeySelective
(
tab
);
}
@Override
public
TabHaobanWxApplication
selectByWxEnterpriseIdAndApplicationType
(
String
wxEnterpriseId
,
int
applicationType
)
{
return
mapper
.
selectByWxEnterpriseIdAndApplicationType
(
wxEnterpriseId
,
applicationType
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/DepartmentApiServiceImpl.java
View file @
c68eb1d2
...
...
@@ -26,9 +26,11 @@ import com.gic.haoban.manage.api.service.DepartmentApiService;
import
com.gic.haoban.manage.service.dao.mapper.DepartmentMapper
;
import
com.gic.haoban.manage.service.entity.TabHaobanDepartment
;
import
com.gic.haoban.manage.service.entity.TabHaobanStaffDepartmentRelated
;
import
com.gic.haoban.manage.service.entity.TabHaobanWxApplication
;
import
com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseRelated
;
import
com.gic.haoban.manage.service.service.DepartmentService
;
import
com.gic.haoban.manage.service.service.StaffDepartmentRelatedService
;
import
com.gic.haoban.manage.service.service.WxApplicationService
;
import
com.gic.haoban.manage.service.service.WxEnterpriseService
;
import
com.gic.wechat.api.service.qywx.QywxDepartmentApiService
;
import
com.github.pagehelper.PageHelper
;
...
...
@@ -55,6 +57,9 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
@Autowired
private
WxEnterpriseService
wxEnterpriseService
;
@Autowired
private
WxApplicationService
wxApplicationService
;
@Override
public
List
<
DepartmentDTO
>
listByParentId
(
String
parentId
)
{
...
...
@@ -76,17 +81,27 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
//调微信的新增接口
String
wxDepartmentId
=
""
;
WxEnterpriseDTO
enterpriseDTO
=
wxEnterpriseService
.
selectById
(
department
.
getWxEnterpriseId
());
TabHaobanWxApplication
application
=
wxApplicationService
.
selectByWxEnterpriseIdAndApplicationType
(
department
.
getWxEnterpriseId
(),
1
);
if
(
enterpriseDTO
!=
null
)
{
//JSONResponse jp = qywxDepartmentApiService.createDepartment(enterpriseDTO.getCorpid(), enterpriseDTO.getsi, departmentDTO);
if
(
StringUtils
.
isBlank
(
wxDepartmentId
))
{
hr
.
setErrorCode
(
0
);
hr
.
setMessage
(
"微信新增部门失败"
);
return
hr
;
if
(
application
!=
null
)
{
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
dto
=
new
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
();
dto
.
setCorpid
(
enterpriseDTO
.
getCorpid
());
dto
.
setName
(
department
.
getDepartmentName
());
dto
.
setOrder
(
department
.
getSort
());
TabHaobanDepartment
parent
=
departmentService
.
selectById
(
department
.
getParentDepartmentId
());
dto
.
setParentid
(
Integer
.
valueOf
(
parent
.
getWxDepartmentId
()));
JSONResponse
jp
=
qywxDepartmentApiService
.
createDepartment
(
enterpriseDTO
.
getCorpid
(),
application
.
getSiteId
(),
dto
);
if
(
jp
.
getErrorCode
()
!=
1
)
{
hr
.
setErrorCode
(
0
);
hr
.
setMessage
(
"微信新增部门失败"
);
return
hr
;
}
wxDepartmentId
=
jp
.
getResult
().
toString
();
department
.
setWxDepartmentId
(
wxDepartmentId
);
String
departmentId
=
departmentService
.
add
(
department
);
department
.
setDepartmentId
(
departmentId
);
hr
.
setResult
(
department
);
}
department
.
setWxDepartmentId
(
wxDepartmentId
);
String
departmentId
=
departmentService
.
add
(
department
);
department
.
setDepartmentId
(
departmentId
);
hr
.
setResult
(
department
);
}
return
hr
;
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/WxEnterpriseApiServiceImpl.java
View file @
c68eb1d2
...
...
@@ -3,6 +3,7 @@ package com.gic.haoban.manage.service.service.out.impl;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -15,7 +16,9 @@ import com.gic.haoban.manage.api.dto.YwWxEnterpriseDTO;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseApiService
;
import
com.gic.haoban.manage.service.dao.mapper.WxEnterpriseMapper
;
import
com.gic.haoban.manage.service.entity.TabHaobanWxApplication
;
import
com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise
;
import
com.gic.haoban.manage.service.service.WxApplicationService
;
import
com.gic.haoban.manage.service.service.WxEnterpriseService
;
@Service
...
...
@@ -27,14 +30,42 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService {
private
StaffApiService
staffApiService
;
@Autowired
private
WxEnterpriseMapper
wxEnterpriseMapper
;
@Autowired
private
WxApplicationService
wxApplicationService
;
@Override
public
void
callbackReviceEnterprise
(
QywxCorpInfoSimpleDTO
dto
)
{
WxEnterpriseDTO
wxDTO
=
EntityUtil
.
changeEntityByJSON
(
WxEnterpriseDTO
.
class
,
dto
.
getClass
());
String
wxEnterpriseId
=
wxEnterpriseService
.
add
(
wxDTO
);
String
userId
=
dto
.
getUserid
();
String
name
=
dto
.
getName
();
staffApiService
.
wxGetAdd
(
userId
,
wxEnterpriseId
);
if
(
StringUtils
.
isNotBlank
(
userId
))
{
staffApiService
.
wxGetAdd
(
userId
,
wxEnterpriseId
);
}
String
siteId
=
dto
.
getSuiteId
();
String
agentId
=
dto
.
getAgentid
();
String
agentName
=
dto
.
getAgentName
();
String
permanentCode
=
dto
.
getPermanentCode
();
String
applicationName
=
dto
.
getName
();
TabHaobanWxApplication
tab
=
wxApplicationService
.
selectBySiteIdAndWxEnterpriseId
(
siteId
,
wxEnterpriseId
);
if
(
tab
==
null
)
{
tab
=
new
TabHaobanWxApplication
();
tab
.
setAgentId
(
agentId
);
tab
.
setSiteId
(
siteId
);
tab
.
setAgentName
(
agentName
);
tab
.
setName
(
applicationName
);
tab
.
setPermanentCode
(
permanentCode
);
tab
.
setWxEnterpriseId
(
wxEnterpriseId
);
wxApplicationService
.
insert
(
tab
);
}
else
{
tab
.
setPermanentCode
(
permanentCode
);
wxApplicationService
.
update
(
tab
);
}
}
...
...
haoban-manage3-service/src/main/resources/mapper/WxApplicationMapper.xml
View file @
c68eb1d2
...
...
@@ -161,4 +161,22 @@
update_time = #{updateTime,jdbcType=TIMESTAMP}
where wx_application_id = #{wxApplicationId,jdbcType=VARCHAR}
</update>
<select
id=
"selectBySiteIdAndWxEnterpriseId"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_wx_application
where site_id = #{siteId,jdbcType=VARCHAR}
and status_flag = 1
and wx_enterprise_id = #{wxEnterpriseId}
</select>
<select
id=
"selectByWxEnterpriseIdAndApplicationType"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_wx_application
where application_type = #{applicationType}
and status_flag = 1
and wx_enterprise_id = #{wxEnterpriseId}
</select>
</mapper>
\ No newline at end of file
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/DepartmentContoller.java
View file @
c68eb1d2
...
...
@@ -67,7 +67,7 @@ public class DepartmentContoller extends WebBaseController{
}
@RequestMapping
(
"
department-level-list
"
)
@RequestMapping
(
"
epartment-list-level
"
)
public
HaobanResponse
departmentLevelList
(
String
parentId
)
{
LoginVO
login
=
(
LoginVO
)
AuthRequestUtil
.
getSessionUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
...
...
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