Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
T
tjmdp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Redmine
Redmine
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
other-project
tjmdp
Commits
68eb2767
Commit
68eb2767
authored
Apr 16, 2019
by
liuyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
dac969ef
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
82 additions
and
9 deletions
+82
-9
MdpController.java
src/main/java/com/qiankun/controller/mdp/MdpController.java
+25
-6
UserDao.java
src/main/java/com/qiankun/dao/UserDao.java
+2
-0
UserDaoImpl.java
src/main/java/com/qiankun/dao/UserDaoImpl.java
+6
-0
UserService.java
src/main/java/com/qiankun/service/UserService.java
+4
-0
PaperIdLoginVo.java
src/main/java/com/qiankun/vo/PaperIdLoginVo.java
+40
-0
system.properties
src/main/resources/system.properties
+5
-3
No files found.
src/main/java/com/qiankun/controller/mdp/MdpController.java
View file @
68eb2767
...
@@ -2,6 +2,7 @@ package com.qiankun.controller.mdp;
...
@@ -2,6 +2,7 @@ package com.qiankun.controller.mdp;
import
cn.binarywang.wx.miniapp.api.WxMaService
;
import
cn.binarywang.wx.miniapp.api.WxMaService
;
import
cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult
;
import
cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult
;
import
com.google.common.base.Strings
;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Maps
;
import
com.qiankun.annotation.Auth
;
import
com.qiankun.annotation.Auth
;
import
com.qiankun.config.WxMaConfiguration
;
import
com.qiankun.config.WxMaConfiguration
;
...
@@ -9,15 +10,13 @@ import com.qiankun.config.WxMaProperties;
...
@@ -9,15 +10,13 @@ import com.qiankun.config.WxMaProperties;
import
com.qiankun.entity.User
;
import
com.qiankun.entity.User
;
import
com.qiankun.service.UserService
;
import
com.qiankun.service.UserService
;
import
com.qiankun.utils.JwtTokenUtil
;
import
com.qiankun.utils.JwtTokenUtil
;
import
com.qiankun.vo.PaperIdLoginVo
;
import
me.chanjar.weixin.common.error.WxErrorException
;
import
me.chanjar.weixin.common.error.WxErrorException
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.ResourceBundle
;
import
java.util.ResourceBundle
;
...
@@ -39,7 +38,7 @@ public class MdpController {
...
@@ -39,7 +38,7 @@ public class MdpController {
@Auth
(
verifyLogin
=
false
,
verifyURL
=
false
)
@Auth
(
verifyLogin
=
false
,
verifyURL
=
false
)
@RequestMapping
(
value
=
"/login"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/login"
,
method
=
RequestMethod
.
GET
)
public
Map
<
String
,
Object
>
login
(
@RequestParam
String
code
){
public
Map
<
String
,
Object
>
login
(
@RequestParam
String
code
)
throws
Exception
{
if
(
StringUtils
.
isBlank
(
code
))
{
if
(
StringUtils
.
isBlank
(
code
))
{
return
null
;
return
null
;
}
}
...
@@ -66,7 +65,27 @@ public class MdpController {
...
@@ -66,7 +65,27 @@ public class MdpController {
return
result
;
return
result
;
}
catch
(
WxErrorException
e
)
{
}
catch
(
WxErrorException
e
)
{
this
.
logger
.
error
(
e
.
getMessage
(),
e
);
this
.
logger
.
error
(
e
.
getMessage
(),
e
);
return
null
;
throw
new
Exception
(
e
.
getMessage
(),
e
);
}
}
@Auth
(
verifyLogin
=
false
,
verifyURL
=
false
)
@RequestMapping
(
value
=
"/loginByPaperId"
,
method
=
RequestMethod
.
POST
)
public
Map
<
String
,
Object
>
loginByPaperId
(
@RequestBody
PaperIdLoginVo
vo
){
User
user
=
userService
.
findByPaperId
(
vo
.
getPaperId
(),
vo
.
getPaperType
());
Map
<
String
,
Object
>
result
=
Maps
.
newConcurrentMap
();
if
(
user
==
null
){
result
.
put
(
"isExist"
,
false
);
}
else
{
if
(!
user
.
getName
().
equals
(
vo
.
getName
())){
result
.
put
(
"errorMsg"
,
"姓名与库中信息不符,请核实后重新提交"
);
}
else
{
user
.
setOpenid
(
vo
.
getOpenid
());
userService
.
save
(
user
);
result
.
put
(
"userInfo"
,
user
);
}
}
result
.
put
(
"isExist"
,
true
);
}
}
return
result
;
}
}
}
src/main/java/com/qiankun/dao/UserDao.java
View file @
68eb2767
...
@@ -7,6 +7,8 @@ import com.qiankun.pages.IPageList;
...
@@ -7,6 +7,8 @@ import com.qiankun.pages.IPageList;
public
interface
UserDao
extends
IDao
<
User
,
String
>
{
public
interface
UserDao
extends
IDao
<
User
,
String
>
{
User
findByPaperId
(
String
paperId
,
String
paperType
);
IPageList
<
User
>
findUserPage
(
String
searchStr
,
String
role
,
String
order
,
String
sort
,
Hints
hints
);
IPageList
<
User
>
findUserPage
(
String
searchStr
,
String
role
,
String
order
,
String
sort
,
Hints
hints
);
User
login
(
String
userName
,
String
password
);
User
login
(
String
userName
,
String
password
);
...
...
src/main/java/com/qiankun/dao/UserDaoImpl.java
View file @
68eb2767
...
@@ -27,6 +27,7 @@ public class UserDaoImpl extends AbsDao<User, String> implements UserDao {
...
@@ -27,6 +27,7 @@ public class UserDaoImpl extends AbsDao<User, String> implements UserDao {
private
static
final
String
VALIDATE_PWD
=
" from User where id = ? and pwd = ? and isRemove=false"
;
private
static
final
String
VALIDATE_PWD
=
" from User where id = ? and pwd = ? and isRemove=false"
;
private
static
final
String
FIND_BY_OPENID
=
"from User where openid = ?"
;
private
static
final
String
FIND_BY_OPENID
=
"from User where openid = ?"
;
private
static
final
String
FIND_BY_PAPERID
=
"from User where paperId = ? and paperType = ?"
;
@Override
@Override
public
Boolean
validateUserExistByPaperId
(
String
paperId
)
{
public
Boolean
validateUserExistByPaperId
(
String
paperId
)
{
...
@@ -112,4 +113,9 @@ public class UserDaoImpl extends AbsDao<User, String> implements UserDao {
...
@@ -112,4 +113,9 @@ public class UserDaoImpl extends AbsDao<User, String> implements UserDao {
public
User
findByOpenid
(
String
openid
)
{
public
User
findByOpenid
(
String
openid
)
{
return
findUnique
(
FIND_BY_OPENID
,
new
Hints
(),
openid
);
return
findUnique
(
FIND_BY_OPENID
,
new
Hints
(),
openid
);
}
}
@Override
public
User
findByPaperId
(
String
paperId
,
String
paperType
)
{
return
findUnique
(
FIND_BY_PAPERID
,
new
Hints
(),
paperId
,
paperType
);
}
}
}
src/main/java/com/qiankun/service/UserService.java
View file @
68eb2767
...
@@ -58,4 +58,8 @@ public class UserService {
...
@@ -58,4 +58,8 @@ public class UserService {
public
User
findByOpenid
(
String
openid
){
public
User
findByOpenid
(
String
openid
){
return
userDao
.
findByOpenid
(
openid
);
return
userDao
.
findByOpenid
(
openid
);
}
}
public
User
findByPaperId
(
String
paperId
,
String
paperType
)
{
return
userDao
.
findByPaperId
(
paperId
,
paperType
);
}
}
}
src/main/java/com/qiankun/vo/PaperIdLoginVo.java
0 → 100644
View file @
68eb2767
package
com
.
qiankun
.
vo
;
public
class
PaperIdLoginVo
{
private
String
paperType
;
private
String
paperId
;
private
String
name
;
private
String
openid
;
public
String
getPaperType
()
{
return
paperType
;
}
public
void
setPaperType
(
String
paperType
)
{
this
.
paperType
=
paperType
;
}
public
String
getPaperId
()
{
return
paperId
;
}
public
void
setPaperId
(
String
paperId
)
{
this
.
paperId
=
paperId
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getOpenid
()
{
return
openid
;
}
public
void
setOpenid
(
String
openid
)
{
this
.
openid
=
openid
;
}
}
src/main/resources/system.properties
View file @
68eb2767
#file_path=D:/file/
#file_path=D:/file/
#
file_path=/Users/liuyang/work/argus_work/tjmdp/udata
file_path
=
/Users/liuyang/work/argus_work/tjmdp/udata
file_path
=
/var/tjmdp/udata
#
file_path=/var/tjmdp/udata
account
=
admin
account
=
admin
...
@@ -12,7 +12,9 @@ rainbowplan.token=
...
@@ -12,7 +12,9 @@ rainbowplan.token=
rainbowplan.aesKey
=
rainbowplan.aesKey
=
rainbowplan.msgDataFormat
=
JSON
rainbowplan.msgDataFormat
=
JSON
tjmdp.appid
=
wx77f58984e50cbc08
tjmdp.appid
=
wx77f58984e50cbc08
tjmdp.secret
=
6e6e00e5c01216c2464a8771cb9bdfca
tjmdp.secret
=
69ea7217fc5cee04f274c872a86be5e7
#tjmdp.appid=wx7289ed9f69379a53
#tjmdp.secret=89be603cffcc97535c97596b36aacf10
tjmdp.token
=
tjmdp.token
=
tjmdp.aesKey
=
tjmdp.aesKey
=
tjmdp.msgDataFormat
=
JSON
tjmdp.msgDataFormat
=
JSON
...
...
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