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
170842a5
Commit
170842a5
authored
Apr 19, 2019
by
liuyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完成新需求修改
parent
19b104a6
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
148 additions
and
38 deletions
+148
-38
RainbowPlanController.java
...qiankun/controller/rainbowplan/RainbowPlanController.java
+48
-16
WishDaoImpl.java
src/main/java/com/qiankun/dao/WishDaoImpl.java
+1
-1
RainbowPlanUser.java
src/main/java/com/qiankun/entity/RainbowPlanUser.java
+10
-1
Wish.java
src/main/java/com/qiankun/entity/Wish.java
+6
-5
ImportWishVo.java
src/main/java/com/qiankun/vo/ImportWishVo.java
+13
-2
SendWishVo.java
src/main/java/com/qiankun/vo/SendWishVo.java
+36
-0
UserInfo.java
src/main/java/com/qiankun/vo/UserInfo.java
+22
-12
WishDetailVo.java
src/main/java/com/qiankun/vo/WishDetailVo.java
+12
-1
No files found.
src/main/java/com/qiankun/controller/rainbowplan/RainbowPlanController.java
View file @
170842a5
...
@@ -25,7 +25,9 @@ import com.qiankun.vo.*;
...
@@ -25,7 +25,9 @@ import com.qiankun.vo.*;
import
me.chanjar.weixin.common.error.WxErrorException
;
import
me.chanjar.weixin.common.error.WxErrorException
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.lang3.RandomUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.dom4j.util.UserDataDocumentFactory
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
...
@@ -203,6 +205,7 @@ public class RainbowPlanController extends BaseController<Object> {
...
@@ -203,6 +205,7 @@ public class RainbowPlanController extends BaseController<Object> {
user
.
setReceiveName
(
info
.
getReceiveName
());
user
.
setReceiveName
(
info
.
getReceiveName
());
user
.
setConnectTel
(
info
.
getConnectTel
());
user
.
setConnectTel
(
info
.
getConnectTel
());
user
.
setReceiveAddress
(
info
.
getReceiveAddress
());
user
.
setReceiveAddress
(
info
.
getReceiveAddress
());
user
.
setDisease
(
info
.
getDisease
());
userDao
.
update
(
user
);
userDao
.
update
(
user
);
}
else
{
}
else
{
throw
new
Exception
(
"保存失败,请求用户不存在"
);
throw
new
Exception
(
"保存失败,请求用户不存在"
);
...
@@ -235,6 +238,7 @@ public class RainbowPlanController extends BaseController<Object> {
...
@@ -235,6 +238,7 @@ public class RainbowPlanController extends BaseController<Object> {
user
.
setConnectTel
(
info
.
getConnectTel
());
user
.
setConnectTel
(
info
.
getConnectTel
());
user
.
setReceiveAddress
(
info
.
getReceiveAddress
());
user
.
setReceiveAddress
(
info
.
getReceiveAddress
());
user
.
setAvatar
(
uploadAvatarPath
+
File
.
separator
+
originalFileName
);
user
.
setAvatar
(
uploadAvatarPath
+
File
.
separator
+
originalFileName
);
user
.
setDisease
(
info
.
getDisease
());
userDao
.
update
(
user
);
userDao
.
update
(
user
);
}
else
{
}
else
{
throw
new
Exception
(
"保存失败,请上传图片"
);
throw
new
Exception
(
"保存失败,请上传图片"
);
...
@@ -365,7 +369,13 @@ public class RainbowPlanController extends BaseController<Object> {
...
@@ -365,7 +369,13 @@ public class RainbowPlanController extends BaseController<Object> {
replyVoList
.
add
(
vo
);
replyVoList
.
add
(
vo
);
}
}
}
}
WishDetailVo
vo
=
new
WishDetailVo
(
wish
,
replyVoList
);
RainbowPlanUser
currentUser
=
userDao
.
findByOpenid
(
openid
);
RainbowPlanUser
babyUser
=
null
;
if
(
currentUser
.
getType
()
==
RainbowPlanUser
.
TYPE_LOVE
){
babyUser
=
userDao
.
find
(
wish
.
getRainbowPlanUserId
());
}
WishDetailVo
vo
=
new
WishDetailVo
(
wish
,
replyVoList
,
babyUser
);
return
vo
;
return
vo
;
}
}
...
@@ -415,6 +425,13 @@ public class RainbowPlanController extends BaseController<Object> {
...
@@ -415,6 +425,13 @@ public class RainbowPlanController extends BaseController<Object> {
}
}
wish
.
setStatus
(
Wish
.
STATUS_SEND
);
wish
.
setStatus
(
Wish
.
STATUS_SEND
);
wishDao
.
update
(
wish
);
wishDao
.
update
(
wish
);
if
(
vo
.
isShowMyAddr
()){
RainbowPlanUser
user
=
userDao
.
find
(
vo
.
getUserId
());
user
.
setReceiveName
(
vo
.
getReceiveName
());
user
.
setReceiveAddress
(
vo
.
getReceiveAddress
());
user
.
setConnectTel
(
vo
.
getConnectTel
());
userDao
.
update
(
user
);
}
result
.
put
(
"status"
,
"OK"
);
result
.
put
(
"status"
,
"OK"
);
return
result
;
return
result
;
}
}
...
@@ -442,21 +459,7 @@ public class RainbowPlanController extends BaseController<Object> {
...
@@ -442,21 +459,7 @@ public class RainbowPlanController extends BaseController<Object> {
wishDao
.
update
(
wish
);
wishDao
.
update
(
wish
);
return
"OK"
;
return
"OK"
;
}
}
@Auth
(
verifyLogin
=
false
,
verifyURL
=
false
)
@RequestMapping
(
value
=
"/isActivity"
,
method
=
RequestMethod
.
GET
)
public
boolean
isActivity
(
@RequestHeader
String
sKey
)
throws
Exception
{
if
(
Strings
.
isNullOrEmpty
(
sKey
)){
throw
new
IllegalArgumentException
(
"请求参数错误"
);
}
String
openid
=
tokenUtil
.
getUsernameFromToken
(
sKey
);
RainbowPlanUser
user
=
userDao
.
findByOpenid
(
openid
);
if
(
user
!=
null
){
//TODO 获取活动开放标识
return
true
;
}
else
{
throw
new
Exception
(
"获取数据失败,请求用户不存在"
);
}
}
@Auth
(
verifyURL
=
false
,
verifyLogin
=
false
)
@Auth
(
verifyURL
=
false
,
verifyLogin
=
false
)
@RequestMapping
(
value
=
"/qrcode"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/qrcode"
,
method
=
RequestMethod
.
GET
)
...
@@ -511,6 +514,7 @@ public class RainbowPlanController extends BaseController<Object> {
...
@@ -511,6 +514,7 @@ public class RainbowPlanController extends BaseController<Object> {
user
.
setCreateTime
(
new
Date
());
user
.
setCreateTime
(
new
Date
());
user
.
setType
(
RainbowPlanUser
.
TYPE_BABY
);
user
.
setType
(
RainbowPlanUser
.
TYPE_BABY
);
user
.
setStatus
(
RainbowPlanUser
.
STATUS_AUDIT
);
user
.
setStatus
(
RainbowPlanUser
.
STATUS_AUDIT
);
user
.
setDisease
(
importWishVo
.
getDisease
());
userDao
.
save
(
user
);
userDao
.
save
(
user
);
...
@@ -533,4 +537,32 @@ public class RainbowPlanController extends BaseController<Object> {
...
@@ -533,4 +537,32 @@ public class RainbowPlanController extends BaseController<Object> {
result
.
put
(
"status"
,
"OK"
);
result
.
put
(
"status"
,
"OK"
);
return
result
;
return
result
;
}
}
@Auth
(
verifyLogin
=
false
,
verifyURL
=
false
)
@RequestMapping
(
value
=
"/testData"
,
method
=
RequestMethod
.
GET
)
public
String
testData
(){
for
(
int
i
=
0
;
i
<
200
;
i
++){
RainbowPlanUser
user
=
new
RainbowPlanUser
();
user
.
setPhone
(
"136123456"
+
RandomUtils
.
nextInt
(
10
,
99
));
user
.
setName
(
"宝宝"
+
i
);
user
.
setNickName
(
"宝宝昵称"
+
i
);
user
.
setGender
(
i
%
2
==
0
?
"1"
:
"2"
);
user
.
setBirthday
(
"2010/4/5"
);
user
.
setDisease
(
"血液病"
);
user
.
setBedNum
(
"12楼302室5床"
);
user
.
setReceiveName
(
"收件人姓名"
);
user
.
setReceiveAddress
(
"收件人地址"
);
user
.
setConnectTel
(
user
.
getPhone
());
userDao
.
save
(
user
);
Wish
wish
=
new
Wish
();
wish
.
setContent
(
"测试心愿测试心愿测试心愿测试心愿测试心愿测试心愿测试心愿"
);
wish
.
setUploadImage
(
"/rainbowplan/wishUploadImage/wxd097672957e48ba8.o6zAJs19Nssw1OXAZZr6YDF-tx6U.0fpELldkHhwg5d73b7fa0dc34be23d4dca9ebe797b28.jpeg"
);
wish
.
setStatus
(
Wish
.
STATUS_PUBLISH
);
wish
.
setRainbowPlanUserId
(
user
.
getId
());
wish
.
setActivityId
(
"c1f41681-0581-45e5-8494-20df3610e2f3"
);
wishDao
.
save
(
wish
);
}
return
"OK"
;
}
}
}
src/main/java/com/qiankun/dao/WishDaoImpl.java
View file @
170842a5
...
@@ -14,7 +14,7 @@ import java.util.List;
...
@@ -14,7 +14,7 @@ import java.util.List;
@Repository
@Repository
public
class
WishDaoImpl
extends
AbsDao
<
Wish
,
String
>
implements
WishDao
{
public
class
WishDaoImpl
extends
AbsDao
<
Wish
,
String
>
implements
WishDao
{
private
static
final
String
FIND_BY_RAINBOWPLANUSERID_SQL
=
" from Wish where rainbowPlanUserId = ? and activityId = ? order by createTime desc"
;
private
static
final
String
FIND_BY_RAINBOWPLANUSERID_SQL
=
" from Wish where rainbowPlanUserId = ? and activityId = ? order by createTime desc"
;
private
static
final
String
FIND_BY_AVAILABLE_ACTIVITY_SQL
=
" from Wish where activityId = ? order by createTime desc"
;
private
static
final
String
FIND_BY_AVAILABLE_ACTIVITY_SQL
=
" from Wish where activityId = ? order by
status asc,
createTime desc"
;
private
static
final
String
FIND_BY_VOLUNTEE_ID
=
" from Wish where volunteerId = ? order by createTime desc"
;
private
static
final
String
FIND_BY_VOLUNTEE_ID
=
" from Wish where volunteerId = ? order by createTime desc"
;
@Override
@Override
public
IPageList
<
Wish
>
findByRainbowPlanUserId
(
String
userId
,
String
activityId
,
Hints
hints
)
{
public
IPageList
<
Wish
>
findByRainbowPlanUserId
(
String
userId
,
String
activityId
,
Hints
hints
)
{
...
...
src/main/java/com/qiankun/entity/RainbowPlanUser.java
View file @
170842a5
...
@@ -22,9 +22,10 @@ public class RainbowPlanUser {
...
@@ -22,9 +22,10 @@ public class RainbowPlanUser {
private
String
phone
;
//注册手机号
private
String
phone
;
//注册手机号
private
String
name
;
//真实姓名
private
String
name
;
//真实姓名
private
String
nickName
;
//昵称
private
String
nickName
;
//昵称
private
String
gender
;
//性别
private
String
gender
;
//性别
1:男孩:2女孩
private
String
birthday
;
//出生日期
private
String
birthday
;
//出生日期
private
String
bedNum
;
//楼层床号
private
String
bedNum
;
//楼层床号
private
String
disease
;
//疾病
private
String
receiveName
;
//收件人姓名
private
String
receiveName
;
//收件人姓名
private
String
connectTel
;
//联系方式
private
String
connectTel
;
//联系方式
private
String
receiveAddress
;
//收件地址
private
String
receiveAddress
;
//收件地址
...
@@ -169,4 +170,12 @@ public class RainbowPlanUser {
...
@@ -169,4 +170,12 @@ public class RainbowPlanUser {
public
void
setType
(
int
type
)
{
public
void
setType
(
int
type
)
{
this
.
type
=
type
;
this
.
type
=
type
;
}
}
public
String
getDisease
()
{
return
disease
;
}
public
void
setDisease
(
String
disease
)
{
this
.
disease
=
disease
;
}
}
}
src/main/java/com/qiankun/entity/Wish.java
View file @
170842a5
...
@@ -9,10 +9,11 @@ import java.util.Date;
...
@@ -9,10 +9,11 @@ import java.util.Date;
@Entity
@Entity
public
class
Wish
{
public
class
Wish
{
public
static
final
int
STATUS_PUBLISH
=
0
;
public
static
final
int
STATUS_PUBLISH
=
0
;
//发布心愿
public
static
final
int
STATUS_RECEIVE
=
1
;
public
static
final
int
STATUS_RECEIVE
=
1
;
//领取心愿
public
static
final
int
STATUS_SEND
=
2
;
public
static
final
int
STATUS_SEND
=
2
;
//寄送礼物
public
static
final
int
STATUS_COMPLETE
=
3
;
public
static
final
int
STATUS_HH_RECEIVE
=
3
;
//红会代收
public
static
final
int
STATUS_COMPLETE
=
4
;
//红会寄出感谢卡或小朋友点圆梦
public
static
final
int
HELP_TYPE_CUSTOM
=
1
;
public
static
final
int
HELP_TYPE_CUSTOM
=
1
;
public
static
final
int
HELP_TYPE_EXPRESS
=
2
;
public
static
final
int
HELP_TYPE_EXPRESS
=
2
;
@Id
@Id
...
@@ -22,7 +23,7 @@ public class Wish {
...
@@ -22,7 +23,7 @@ public class Wish {
private
String
title
;
//愿望标题
private
String
title
;
//愿望标题
private
String
content
;
//愿望内容
private
String
content
;
//愿望内容
private
String
uploadImage
;
//上传的图片
private
String
uploadImage
;
//上传的图片
private
int
status
;
//愿望状态,0:发布;1:领取;2.寄送中;3:
实现
private
int
status
;
//愿望状态,0:发布;1:领取;2.寄送中;3:
红会代收;4:完成
private
String
volunteerId
;
//领取愿望的爱心人士ID
private
String
volunteerId
;
//领取愿望的爱心人士ID
private
String
rainbowPlanUserId
;
//小朋友ID
private
String
rainbowPlanUserId
;
//小朋友ID
private
Date
createTime
=
new
Date
();
private
Date
createTime
=
new
Date
();
...
...
src/main/java/com/qiankun/vo/ImportWishVo.java
View file @
170842a5
...
@@ -2,6 +2,8 @@ package com.qiankun.vo;
...
@@ -2,6 +2,8 @@ package com.qiankun.vo;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.util.PrimitiveIterator
;
public
class
ImportWishVo
{
public
class
ImportWishVo
{
private
String
phone
;
//注册手机号
private
String
phone
;
//注册手机号
private
String
name
;
//真实姓名
private
String
name
;
//真实姓名
...
@@ -12,8 +14,9 @@ public class ImportWishVo {
...
@@ -12,8 +14,9 @@ public class ImportWishVo {
private
String
receiveName
;
//收件人姓名
private
String
receiveName
;
//收件人姓名
private
String
connectTel
;
//联系方式
private
String
connectTel
;
//联系方式
private
String
receiveAddress
;
//收件地址
private
String
receiveAddress
;
//收件地址
public
String
wish
;
//心愿
private
String
wish
;
//心愿
public
MultipartFile
file
;
//心愿图片
private
String
disease
;
//疾病
private
MultipartFile
file
;
//心愿图片
public
String
getPhone
()
{
public
String
getPhone
()
{
return
phone
;
return
phone
;
...
@@ -102,4 +105,12 @@ public class ImportWishVo {
...
@@ -102,4 +105,12 @@ public class ImportWishVo {
public
void
setFile
(
MultipartFile
file
)
{
public
void
setFile
(
MultipartFile
file
)
{
this
.
file
=
file
;
this
.
file
=
file
;
}
}
public
String
getDisease
()
{
return
disease
;
}
public
void
setDisease
(
String
disease
)
{
this
.
disease
=
disease
;
}
}
}
src/main/java/com/qiankun/vo/SendWishVo.java
View file @
170842a5
...
@@ -6,6 +6,10 @@ public class SendWishVo {
...
@@ -6,6 +6,10 @@ public class SendWishVo {
private
int
helpType
;
private
int
helpType
;
private
String
expressCompany
;
private
String
expressCompany
;
private
String
expressCode
;
private
String
expressCode
;
private
boolean
showMyAddr
;
private
String
receiveName
;
private
String
receiveAddress
;
private
String
connectTel
;
public
String
getWishId
()
{
public
String
getWishId
()
{
return
wishId
;
return
wishId
;
...
@@ -46,4 +50,36 @@ public class SendWishVo {
...
@@ -46,4 +50,36 @@ public class SendWishVo {
public
void
setExpressCode
(
String
expressCode
)
{
public
void
setExpressCode
(
String
expressCode
)
{
this
.
expressCode
=
expressCode
;
this
.
expressCode
=
expressCode
;
}
}
public
boolean
isShowMyAddr
()
{
return
showMyAddr
;
}
public
void
setShowMyAddr
(
boolean
showMyAddr
)
{
this
.
showMyAddr
=
showMyAddr
;
}
public
String
getReceiveName
()
{
return
receiveName
;
}
public
void
setReceiveName
(
String
receiveName
)
{
this
.
receiveName
=
receiveName
;
}
public
String
getReceiveAddress
()
{
return
receiveAddress
;
}
public
void
setReceiveAddress
(
String
receiveAddress
)
{
this
.
receiveAddress
=
receiveAddress
;
}
public
String
getConnectTel
()
{
return
connectTel
;
}
public
void
setConnectTel
(
String
connectTel
)
{
this
.
connectTel
=
connectTel
;
}
}
}
src/main/java/com/qiankun/vo/UserInfo.java
View file @
170842a5
...
@@ -4,18 +4,20 @@ import org.springframework.web.multipart.MultipartFile;
...
@@ -4,18 +4,20 @@ import org.springframework.web.multipart.MultipartFile;
public
class
UserInfo
{
public
class
UserInfo
{
public
String
uid
;
private
String
uid
;
public
String
phone
;
private
String
phone
;
public
String
name
;
private
String
name
;
public
String
nickName
;
private
String
nickName
;
public
String
gender
;
private
String
gender
;
public
String
birthday
;
private
String
birthday
;
public
String
bedNum
;
private
String
bedNum
;
public
String
receiveName
;
private
String
receiveName
;
public
String
connectTel
;
private
String
connectTel
;
public
String
receiveAddress
;
private
String
receiveAddress
;
public
String
avatar
;
private
String
avatar
;
public
MultipartFile
file
;
private
String
disease
;
private
MultipartFile
file
;
public
String
getUid
()
{
public
String
getUid
()
{
return
uid
;
return
uid
;
...
@@ -112,4 +114,12 @@ public class UserInfo {
...
@@ -112,4 +114,12 @@ public class UserInfo {
public
void
setFile
(
MultipartFile
file
)
{
public
void
setFile
(
MultipartFile
file
)
{
this
.
file
=
file
;
this
.
file
=
file
;
}
}
public
String
getDisease
()
{
return
disease
;
}
public
void
setDisease
(
String
disease
)
{
this
.
disease
=
disease
;
}
}
}
src/main/java/com/qiankun/vo/WishDetailVo.java
View file @
170842a5
package
com
.
qiankun
.
vo
;
package
com
.
qiankun
.
vo
;
import
com.qiankun.entity.RainbowPlanUser
;
import
com.qiankun.entity.Wish
;
import
com.qiankun.entity.Wish
;
import
com.qiankun.entity.WishReply
;
import
com.qiankun.entity.WishReply
;
...
@@ -8,13 +9,15 @@ import java.util.List;
...
@@ -8,13 +9,15 @@ import java.util.List;
public
class
WishDetailVo
{
public
class
WishDetailVo
{
private
Wish
wish
;
private
Wish
wish
;
private
List
<
WishReplyVo
>
replys
;
private
List
<
WishReplyVo
>
replys
;
private
RainbowPlanUser
babyUserInfo
;
public
WishDetailVo
(){
public
WishDetailVo
(){
}
}
public
WishDetailVo
(
Wish
wish
,
List
<
WishReplyVo
>
replys
){
public
WishDetailVo
(
Wish
wish
,
List
<
WishReplyVo
>
replys
,
RainbowPlanUser
babyUserInfo
){
this
.
wish
=
wish
;
this
.
wish
=
wish
;
this
.
replys
=
replys
;
this
.
replys
=
replys
;
this
.
babyUserInfo
=
babyUserInfo
;
}
}
public
Wish
getWish
()
{
public
Wish
getWish
()
{
return
wish
;
return
wish
;
...
@@ -31,4 +34,12 @@ public class WishDetailVo {
...
@@ -31,4 +34,12 @@ public class WishDetailVo {
public
void
setReplys
(
List
<
WishReplyVo
>
replys
)
{
public
void
setReplys
(
List
<
WishReplyVo
>
replys
)
{
this
.
replys
=
replys
;
this
.
replys
=
replys
;
}
}
public
RainbowPlanUser
getBabyUserInfo
()
{
return
babyUserInfo
;
}
public
void
setBabyUserInfo
(
RainbowPlanUser
babyUserInfo
)
{
this
.
babyUserInfo
=
babyUserInfo
;
}
}
}
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