Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
tianjin-cement
Project
Project
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
竹天卫
tianjin-cement
Commits
af1c91a9
Commit
af1c91a9
authored
Dec 15, 2020
by
竹天卫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
企业微信用户自动登录信息
parent
9de559e2
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
81 additions
and
2 deletions
+81
-2
pom.xml
cement-business/pom.xml
+16
-0
SysGroupController.java
...ise/sc/cement/business/controller/SysGroupController.java
+3
-0
SysPostController.java
...wise/sc/cement/business/controller/SysPostController.java
+3
-0
WeiXinController.java
.../wise/sc/cement/business/controller/WeiXinController.java
+2
-1
SysRoleServiceImpl.java
...e/sc/cement/business/service/impl/SysRoleServiceImpl.java
+3
-0
WeiXinService.java
...n/wise/sc/cement/business/service/impl/WeiXinService.java
+54
-1
No files found.
cement-business/pom.xml
View file @
af1c91a9
...
...
@@ -168,6 +168,22 @@
<artifactId>
jfreechart
</artifactId>
<version>
1.5.0
</version>
</dependency>
<!-- lombok start -->
<dependency>
<groupId>
org.projectlombok
</groupId>
<artifactId>
lombok
</artifactId>
<version>
1.18.2
</version>
<scope>
provided
</scope>
</dependency>
<!-- lombok end -->
<dependency>
<groupId>
org.json
</groupId>
<artifactId>
json
</artifactId>
<version>
20180130
</version>
</dependency>
</dependencies>
<build>
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/controller/SysGroupController.java
View file @
af1c91a9
...
...
@@ -105,6 +105,9 @@ public class SysGroupController {
@PostMapping
(
"/delete/{id}"
)
public
BaseResponse
delete
(
@PathVariable
Integer
id
)
{
try
{
if
(
id
==
1
||
id
==
2
){
return
BaseResponse
.
errorMsg
(
"工作组不允许删除!"
);
}
QueryWrapper
<
SysUser
>
sysUserQueryWrapper
=
new
QueryWrapper
<>();
sysUserQueryWrapper
.
eq
(
"group_id"
,
id
);
Integer
conunts
=
userService
.
count
(
sysUserQueryWrapper
);
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/controller/SysPostController.java
View file @
af1c91a9
...
...
@@ -107,6 +107,9 @@ public class SysPostController {
@PostMapping
(
"/delete/{id}"
)
public
BaseResponse
delete
(
@PathVariable
Integer
id
)
{
try
{
if
(
id
==
1
||
id
==
2
){
return
BaseResponse
.
errorMsg
(
"职务不允许删除!"
);
}
QueryWrapper
<
SysUser
>
sysUserQueryWrapper
=
new
QueryWrapper
<>();
sysUserQueryWrapper
.
eq
(
"post_id"
,
id
);
Integer
conunts
=
userService
.
count
(
sysUserQueryWrapper
);
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/controller/WeiXinController.java
View file @
af1c91a9
...
...
@@ -10,6 +10,7 @@ import org.slf4j.Logger;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.transaction.interceptor.TransactionAspectSupport
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
...
...
@@ -17,6 +18,7 @@ import java.security.MessageDigest;
import
java.security.NoSuchAlgorithmException
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
@Api
(
tags
=
"微信接口"
)
...
...
@@ -155,5 +157,4 @@ public class WeiXinController {
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/SysRoleServiceImpl.java
View file @
af1c91a9
...
...
@@ -144,6 +144,9 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
if
(
id
==
1
){
return
BaseResponse
.
errorMsg
(
"系统管理员角色不允许删除!"
);
}
if
(
id
==
2
){
return
BaseResponse
.
errorMsg
(
"角色不允许删除!"
);
}
SysRole
role
=
roleMapper
.
selectById
(
id
);
if
(
role
==
null
)
{
return
BaseResponse
.
errorMsg
(
"角色不存在!"
);
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/WeiXinService.java
View file @
af1c91a9
...
...
@@ -5,6 +5,7 @@ import cn.hutool.core.util.StrUtil;
import
cn.wise.sc.cement.business.entity.SysUser
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.LoginUser
;
import
cn.wise.sc.cement.business.model.query.UserQuery
;
import
cn.wise.sc.cement.business.service.ISysUserService
;
import
cn.wise.sc.cement.business.util.JwtUtil
;
import
cn.wise.sc.cement.business.util.RedisUtil
;
...
...
@@ -14,16 +15,21 @@ import cn.wise.sc.cement.business.util.weixin.WeixinInterfaceUtil;
import
cn.wise.sc.cement.business.util.weixin.message.send.BaseMessage
;
import
cn.wise.sc.cement.business.util.weixin.message.send.Text
;
import
cn.wise.sc.cement.business.util.weixin.message.send.TextMessage
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.google.common.base.Strings
;
import
com.google.gson.Gson
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.interceptor.TransactionAspectSupport
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.List
;
@Service
public
class
WeiXinService
{
...
...
@@ -122,7 +128,28 @@ public class WeiXinService {
wrapper
.
eq
(
"phone"
,
userJson
.
get
(
"mobile"
));
SysUser
sysUser
=
userService
.
getOne
(
wrapper
);
if
(
sysUser
==
null
)
{
return
BaseResponse
.
errorMsg
(
"非系统用户不允许登录!"
);
UserQuery
query
=
new
UserQuery
();
query
.
setUsername
(
userJson
.
getString
(
"userid"
));
query
.
setName
(
userJson
.
getString
(
"name"
));
Integer
sexVal
=
userJson
.
getInteger
(
"gender"
);
//企业微信1男2女 系统1男0女
query
.
setSex
(
sexVal
==
1
?
1
:
sexVal
==
2
?
0
:
null
);
query
.
setGroupId
(
2
);
query
.
setPostId
(
2
);
query
.
setWxId
(
userJson
.
getString
(
"userid"
));
query
.
setQualifications
(
userJson
.
getString
(
"position"
));
query
.
setWorkYear
(
null
);
query
.
setPhone
(
userJson
.
getString
(
"mobile"
));
query
.
setFax
(
null
);
query
.
setMajor
(
null
);
query
.
setEmail
(
userJson
.
getString
(
"email"
));
query
.
setTechnologyDate
(
null
);
query
.
setTechnologyYear
(
null
);
query
.
setEducation
(
null
);
query
.
setRemark
(
null
);
query
.
setRoleId
(
2
);
BaseResponse
<
SysUser
>
baseResponse
=
userService
.
create
(
query
);
sysUser
=
baseResponse
.
getData
();
// return BaseResponse.errorMsg("非系统用户不允许登录!");
}
if
(
sysUser
.
getStatus
()
==
0
)
{
return
BaseResponse
.
errorMsg
(
"用户被禁用!"
);
...
...
@@ -302,4 +329,30 @@ public class WeiXinService {
BigDecimal
bigDecimal
=
NumberUtil
.
toBigDecimal
(
StrUtil
.
trim
(
"111 "
));
}
}
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