Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Administrator
/
yry_java
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
9c9e1a2a
authored
2017-12-29 18:00:41 +0800
by
ja
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
no message
1 parent
bce2c347
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
35 additions
and
21 deletions
yry_dp/src/main/java/com/example/controller/api/HapiController.java
yry_dp/src/main/java/com/example/mapper/api/MemberInfoMapper.java
yry_dp/src/main/java/com/example/models/api/MemberInfo.java
yry_dp/src/main/java/com/example/service/api/HapiService.java
yry_dp/src/main/java/com/example/service/api/HapiServiceImpl.java
yry_dp/src/main/resources/mappers/MemberInfoMapper.xml
yry_dp/src/main/java/com/example/controller/api/HapiController.java
View file @
9c9e1a2
...
...
@@ -19,24 +19,26 @@ public class HapiController {
@RequestMapping
(
"/register"
)
public
MessageEntity
register
(
@RequestParam
(
"barcode"
)
String
barcode
,
@RequestParam
(
"openid"
)
String
openid
,
@RequestParam
(
"name"
)
String
name
,
@RequestParam
(
"gender"
)
String
gender
,
@RequestParam
(
"birthdayStr"
)
String
birthdayStr
,
@RequestParam
(
"mobileNumber"
)
String
mobileNumber
,
@RequestParam
(
"samplingDate"
)
String
samplingDate
,
@RequestParam
(
"recipients"
)
String
recipients
,
@RequestParam
(
"address"
)
String
address
,
@RequestParam
(
"familyDisease"
)
String
familyDisease
,
@RequestParam
(
"existingDisease"
)
String
existingDisease
,
@RequestParam
(
"weight"
)
Float
weight
,
@RequestParam
(
"height"
)
Integer
height
,
@RequestParam
(
value
=
"remarks"
,
required
=
false
)
String
remarks
){
return
this
.
hapiService
.
register
(
barcode
,
name
,
gender
,
birthdayStr
,
mobileNumber
,
samplingDate
,
recipients
,
address
,
familyDisease
,
existingDisease
,
weight
,
height
,
remarks
);
return
this
.
hapiService
.
register
(
barcode
,
openid
,
name
,
gender
,
birthdayStr
,
mobileNumber
,
samplingDate
,
recipients
,
address
,
familyDisease
,
existingDisease
,
weight
,
height
,
remarks
);
}
@RequestMapping
(
"/genereport"
)
public
MessageEntity
genereport
(
@RequestParam
(
"barcode"
)
String
barcode
,
@RequestParam
(
"mobileNumber"
)
String
mobileNumber
){
return
this
.
hapiService
.
genereport
(
barcode
,
mobileNumber
);
@RequestParam
(
"mobileNumber"
)
String
mobileNumber
,
@RequestParam
(
"openid"
)
String
openid
){
return
this
.
hapiService
.
genereport
(
barcode
,
mobileNumber
,
openid
);
}
@RequestMapping
(
"/getby
mobile
"
)
@RequestMapping
(
"/getby
openid
"
)
public
MessageEntity
getbymobile
(
@RequestParam
(
"
mobileNumber"
)
String
mobileNumber
){
return
this
.
hapiService
.
getBy
MobileNumber
(
mobileNumber
);
@RequestParam
(
"
openid"
)
String
openid
){
return
this
.
hapiService
.
getBy
openid
(
openid
);
}
@RequestMapping
(
"/memberlist"
)
...
...
yry_dp/src/main/java/com/example/mapper/api/MemberInfoMapper.java
View file @
9c9e1a2
...
...
@@ -13,7 +13,7 @@ import java.util.Map;
public
interface
MemberInfoMapper
{
boolean
create
(
MemberInfo
memberInfo
);
MemberInfo
getBy
MobileNumber
(
@Param
(
"mobileNumber"
)
String
mobileNumber
);
MemberInfo
getBy
openid
(
@Param
(
"openid"
)
String
openid
);
boolean
genereport
(
@Param
(
"isGenereport"
)
Integer
isGenereport
,
@Param
(
"genereportAt"
)
Date
genereportAt
,
...
...
@@ -21,7 +21,7 @@ public interface MemberInfoMapper {
@Param
(
"pdfName"
)
String
pdfName
,
@Param
(
"url"
)
String
url
,
@Param
(
"genereportName"
)
String
genereportName
,
@Param
(
"
mobileNumber"
)
String
mobileNumber
);
@Param
(
"
openid"
)
String
openid
);
List
<
MemberInfo
>
list
(
@Param
(
"keyWord"
)
String
keyWord
,
@Param
(
"status"
)
Integer
status
,
@Param
(
"pageable"
)
Pageable
pageable
);
...
...
yry_dp/src/main/java/com/example/models/api/MemberInfo.java
View file @
9c9e1a2
...
...
@@ -33,6 +33,7 @@ public class MemberInfo {
String
pdfName
;
String
url
;
String
genereportName
;
String
openid
;
public
Long
getId
()
{
return
id
;
...
...
@@ -249,4 +250,12 @@ public class MemberInfo {
public
void
setGenereportName
(
String
genereportName
)
{
this
.
genereportName
=
genereportName
;
}
public
String
getOpenid
()
{
return
openid
;
}
public
void
setOpenid
(
String
openid
)
{
this
.
openid
=
openid
;
}
}
...
...
yry_dp/src/main/java/com/example/service/api/HapiService.java
View file @
9c9e1a2
...
...
@@ -11,12 +11,12 @@ import java.util.List;
public
interface
HapiService
{
MessageEntity
register
(
String
barcode
,
String
name
,
String
gender
,
String
birthdayStr
,
String
mobileNumber
,
String
samplingDate
,
MessageEntity
register
(
String
barcode
,
String
openid
,
String
name
,
String
gender
,
String
birthdayStr
,
String
mobileNumber
,
String
samplingDate
,
String
recipients
,
String
address
,
String
familyDisease
,
String
existingDisease
,
Float
weight
,
Integer
height
,
String
remarks
);
MessageEntity
getBy
MobileNumber
(
String
mobileNumber
);
MessageEntity
getBy
openid
(
String
mobileNumber
);
MessageEntity
genereport
(
String
barcode
,
String
mobileNumber
);
MessageEntity
genereport
(
String
barcode
,
String
mobileNumber
,
String
openid
);
MessageEntity
reportByDay
(
String
beginTime
,
String
endTime
);
...
...
yry_dp/src/main/java/com/example/service/api/HapiServiceImpl.java
View file @
9c9e1a2
...
...
@@ -52,7 +52,7 @@ public class HapiServiceImpl implements HapiService {
@Override
public
MessageEntity
register
(
String
barcode
,
String
name
,
String
gender
,
String
birthdayStr
,
String
mobileNumber
,
String
samplingDate
,
public
MessageEntity
register
(
String
barcode
,
String
openid
,
String
name
,
String
gender
,
String
birthdayStr
,
String
mobileNumber
,
String
samplingDate
,
String
recipients
,
String
address
,
String
familyDisease
,
String
existingDisease
,
Float
weight
,
Integer
height
,
String
remarks
)
{
long
timestamp
=
new
Date
().
getTime
()/
1000
;
MessageEntity
.
Builder
builder
=
new
MessageEntity
.
Builder
();
...
...
@@ -83,6 +83,7 @@ public class HapiServiceImpl implements HapiService {
if
(
map
.
containsKey
(
"ret"
)
&&
map
.
get
(
"ret"
).
toString
().
equals
(
"0"
)
&&
map
.
containsKey
(
"uuid"
)){
String
memberNumber
=
map
.
get
(
"uuid"
)
!=
null
?
map
.
get
(
"uuid"
).
toString
()
:
""
;
MemberInfo
memberInfo
=
new
MemberInfo
();
memberInfo
.
setOpenid
(
openid
);
memberInfo
.
setStatus
(
1
);
memberInfo
.
setAddress
(
address
);
memberInfo
.
setBarcode
(
barcode
);
...
...
@@ -110,7 +111,7 @@ public class HapiServiceImpl implements HapiService {
@Override
public
MessageEntity
genereport
(
String
barcode
,
String
mobileNumber
)
{
public
MessageEntity
genereport
(
String
barcode
,
String
mobileNumber
,
String
openid
)
{
long
timestamp
=
new
Date
().
getTime
()/
1000
;
MessageEntity
.
Builder
builder
=
new
MessageEntity
.
Builder
();
Map
<
String
,
Object
>
paremMap
=
new
HashMap
<>();
...
...
@@ -132,14 +133,14 @@ public class HapiServiceImpl implements HapiService {
String
name
=
map
.
get
(
"name"
)
!=
null
?
map
.
get
(
"name"
).
toString
()
:
""
;
String
packName
=
map
.
get
(
"packName"
)
!=
null
?
map
.
get
(
"packName"
).
toString
()
:
""
;
String
pdfName
=
map
.
get
(
"pdfName"
)
!=
null
?
map
.
get
(
"pdfName"
).
toString
()
:
""
;
this
.
memberInfoMapper
.
genereport
(
1
,
new
Date
(),
packName
,
pdfName
,
pdfurl
,
name
,
mobileNumber
);
this
.
memberInfoMapper
.
genereport
(
1
,
new
Date
(),
packName
,
pdfName
,
pdfurl
,
name
,
openid
);
}
return
builder
.
success
(
true
).
code
(
"2000"
).
content
(
map
).
create
();
}
public
MessageEntity
getBy
MobileNumber
(
String
mobileNumber
){
public
MessageEntity
getBy
openid
(
String
openid
){
MessageEntity
.
Builder
builder
=
new
MessageEntity
.
Builder
();
MemberInfo
memberInfo
=
this
.
memberInfoMapper
.
getBy
MobileNumber
(
mobileNumber
);
MemberInfo
memberInfo
=
this
.
memberInfoMapper
.
getBy
openid
(
openid
);
if
(
memberInfo
==
null
||
memberInfo
.
getId
()
==
0
){
//账号不存在
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
...
...
yry_dp/src/main/resources/mappers/MemberInfoMapper.xml
View file @
9c9e1a2
...
...
@@ -25,7 +25,8 @@
remarks,
member_number,
create_at,
status
status,
openid
)
VALUES (
#{source},
...
...
@@ -47,12 +48,13 @@
#{remarks},
#{memberNumber},
#{createAt},
#{status}
#{status},
#{openid}
);
</insert>
<select
id=
"getBy
MobileNumber
"
resultType=
"com.example.models.api.MemberInfo"
>
select * from t_hpai_member_info where
mobile_number = #{mobileNumber
} limit 1;
<select
id=
"getBy
openid
"
resultType=
"com.example.models.api.MemberInfo"
>
select * from t_hpai_member_info where
openid = #{openid
} limit 1;
</select>
<update
id=
"genereport"
>
...
...
@@ -62,7 +64,7 @@
pack_name = #{packName},
pdf_name = #{pdfName},
url = #{url},
genereport_name = #{genereportName} where
mobile_number = #{mobileNumber
};
genereport_name = #{genereportName} where
openid = #{openid
};
</update>
...
...
Please
register
or
sign in
to post a comment