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
b18656a5
Commit
b18656a5
authored
Feb 21, 2020
by
qwmqiuwenmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
48e9a03a
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
93 additions
and
15 deletions
+93
-15
StaffApiService.java
...va/com/gic/haoban/manage/api/service/StaffApiService.java
+2
-0
DepartmentApiServiceImpl.java
...ge/service/service/out/impl/DepartmentApiServiceImpl.java
+33
-12
StaffApiServiceImpl.java
.../manage/service/service/out/impl/StaffApiServiceImpl.java
+5
-0
pom.xml
haoban-manage3-web/pom.xml
+5
-0
LoginController.java
...com/gic/haoban/manage/web/controller/LoginController.java
+17
-3
NationcodeController.java
...ic/haoban/manage/web/controller/NationcodeController.java
+31
-0
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/StaffApiService.java
View file @
b18656a5
...
...
@@ -31,4 +31,6 @@ public interface StaffApiService {
public
void
syscGicClerk
(
String
fieldListString
);
public
StaffDTO
selectByUserId
(
String
userId
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/DepartmentApiServiceImpl.java
View file @
b18656a5
...
...
@@ -112,11 +112,24 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
HaobanResponse
hr
=
new
HaobanResponse
();
hr
.
setErrorCode
(
1
);
//调微信的修改接口
String
wxDepartmentId
=
""
;
if
(
StringUtils
.
isBlank
(
wxDepartmentId
))
{
hr
.
setErrorCode
(
0
);
hr
.
setMessage
(
"微信修改部门失败"
);
return
hr
;
TabHaobanDepartment
tab
=
departmentService
.
selectById
(
department
.
getDepartmentId
());
WxEnterpriseDTO
enterpriseDTO
=
wxEnterpriseService
.
selectById
(
tab
.
getWxEnterpriseId
());
TabHaobanWxApplication
application
=
wxApplicationService
.
selectByWxEnterpriseIdAndApplicationType
(
tab
.
getWxEnterpriseId
(),
1
);
if
(
enterpriseDTO
!=
null
)
{
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
.
updateDepartment
(
enterpriseDTO
.
getCorpid
(),
application
.
getSiteId
(),
dto
);
if
(
jp
.
getErrorCode
()
!=
1
)
{
hr
.
setErrorCode
(
0
);
hr
.
setMessage
(
"微信修改部门失败"
);
return
hr
;
}
}
}
departmentService
.
edit
(
department
);
...
...
@@ -127,13 +140,7 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
public
HaobanResponse
del
(
String
departmentId
)
{
HaobanResponse
hr
=
new
HaobanResponse
();
hr
.
setErrorCode
(
1
);
//调微信的新增接口
String
wxDepartmentId
=
""
;
if
(
StringUtils
.
isBlank
(
wxDepartmentId
))
{
hr
.
setErrorCode
(
0
);
hr
.
setMessage
(
"微信删除部门失败"
);
return
hr
;
}
List
<
TabHaobanDepartment
>
list
=
departmentService
.
listByParentId
(
departmentId
);
if
(!
list
.
isEmpty
())
{
hr
.
setErrorCode
(
0
);
...
...
@@ -147,6 +154,20 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
hr
.
setMessage
(
"存在成员,删除部门失败"
);
return
hr
;
}
//调微信的新增接口
TabHaobanDepartment
department
=
departmentService
.
selectById
(
departmentId
);
WxEnterpriseDTO
enterpriseDTO
=
wxEnterpriseService
.
selectById
(
department
.
getWxEnterpriseId
());
TabHaobanWxApplication
application
=
wxApplicationService
.
selectByWxEnterpriseIdAndApplicationType
(
department
.
getWxEnterpriseId
(),
1
);
if
(
enterpriseDTO
!=
null
)
{
if
(
application
!=
null
)
{
JSONResponse
jp
=
qywxDepartmentApiService
.
deleteDepartment
(
enterpriseDTO
.
getCorpid
(),
application
.
getSiteId
(),
Integer
.
parseInt
(
department
.
getWxDepartmentId
()));
if
(
jp
.
getErrorCode
()
!=
1
)
{
hr
.
setErrorCode
(
0
);
hr
.
setMessage
(
"微信删除部门失败"
);
return
hr
;
}
}
}
departmentService
.
del
(
departmentId
);
return
hr
;
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffApiServiceImpl.java
View file @
b18656a5
...
...
@@ -220,4 +220,9 @@ public class StaffApiServiceImpl implements StaffApiService {
}
@Override
public
StaffDTO
selectByUserId
(
String
userId
)
{
return
EntityUtil
.
changeEntityByJSON
(
StaffDTO
.
class
,
staffService
.
selectByUserId
(
userId
));
}
}
haoban-manage3-web/pom.xml
View file @
b18656a5
...
...
@@ -63,6 +63,11 @@
</dependency>
<dependency>
<groupId>
com.gic
</groupId>
<artifactId>
gic-wechat-api
</artifactId>
<version>
${gic-wechat-api}
</version>
</dependency>
<dependency>
<groupId>
com.gic
</groupId>
<artifactId>
gic-commons
</artifactId>
<version>
${gic-commons}
</version>
<exclusions>
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/LoginController.java
View file @
b18656a5
...
...
@@ -9,11 +9,14 @@ import org.springframework.web.bind.annotation.RestController;
import
com.alibaba.fastjson.JSON
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.web.auth.AuthRequestUtil
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.vo.LoginVO
;
import
com.gic.wechat.api.service.qywx.QywxCorpApiService
;
@RestController
public
class
LoginController
extends
WebBaseController
{
...
...
@@ -22,8 +25,18 @@ public class LoginController extends WebBaseController{
@Autowired
StaffApiService
staffApiService
;
@Autowired
private
QywxCorpApiService
qywxCorpApiService
;
public
static
final
String
siteId
=
"ww7d6566614055cf27"
;
public
static
final
String
redirectUri
=
"https://www.gicdev.com/haoban-manage3-web/login"
;
@RequestMapping
(
"login"
)
public
HaobanResponse
login
()
{
public
HaobanResponse
login
(
String
code
)
{
String
userId
=
qywxCorpApiService
.
getUserInfoSimple
(
siteId
,
code
);
StaffDTO
loginStaff
=
staffApiService
.
selectByUserId
(
userId
);
LoginVO
loginVO
=
new
LoginVO
();
StaffDTO
staff
=
staffApiService
.
selectById
(
"1"
);
logger
.
info
(
"【好办登录】staff={}"
,
JSON
.
toJSONString
(
staff
));
...
...
@@ -36,12 +49,13 @@ public class LoginController extends WebBaseController{
@RequestMapping
(
"get-login-qrcode"
)
public
HaobanResponse
getLoginQrcode
(){
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
""
);
String
url
=
qywxCorpApiService
.
getGrantAuthorizationUrl
(
siteId
,
redirectUri
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
url
);
}
//运维登录
@RequestMapping
(
"yw-login"
)
public
HaobanResponse
l
ogin
(
String
wxEnterpriseId
)
{
public
HaobanResponse
ywL
ogin
(
String
wxEnterpriseId
)
{
//TODO 获取超级管理员账号接口
StaffDTO
staff
=
new
StaffDTO
();
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/NationcodeController.java
0 → 100644
View file @
b18656a5
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
;
import
java.util.List
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.gic.dict.api.dto.NationCodeDTO
;
import
com.gic.dict.api.service.ManagerDictService
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
@RequestMapping
(
"/nationcode"
)
@RestController
public
class
NationcodeController
extends
WebBaseController
{
@Autowired
ManagerDictService
managerDictService
;
private
static
final
String
NATION_CODE
=
"NATION_CODE"
;
/**
* 获取国际码
* @return
*/
@RequestMapping
(
"/get-nationcode-list"
)
public
HaobanResponse
getNationcodeList
(){
List
<
NationCodeDTO
>
list
=
managerDictService
.
getDictList
(
NATION_CODE
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
list
);
}
}
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