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
edf2b27d
Commit
edf2b27d
authored
Apr 26, 2019
by
liuchao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
8b7f5357
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
266 additions
and
21 deletions
+266
-21
RainbowPlanController.java
...qiankun/controller/rainbowplan/RainbowPlanController.java
+18
-3
RainbowPlanWebController.java
...nkun/controller/rainbowplan/RainbowPlanWebController.java
+74
-0
WishDaoImpl.java
src/main/java/com/qiankun/dao/WishDaoImpl.java
+6
-1
WishVo.java
src/main/java/com/qiankun/vo/WishVo.java
+21
-0
system.properties
src/main/resources/system.properties
+2
-2
userlist.jsp
src/main/webapp/WEB-INF/pages/rainbow/userlist.jsp
+2
-2
wishlist.jsp
src/main/webapp/WEB-INF/pages/rainbow/wishlist.jsp
+13
-11
wishview.jsp
src/main/webapp/WEB-INF/pages/rainbow/wishview.jsp
+0
-0
rainbowuser.js
src/main/webapp/resources/js/rainbow/rainbowuser.js
+4
-0
wish.js
src/main/webapp/resources/js/rainbow/wish.js
+126
-2
No files found.
src/main/java/com/qiankun/controller/rainbowplan/RainbowPlanController.java
View file @
edf2b27d
...
@@ -238,10 +238,26 @@ public class RainbowPlanController extends BaseController<Object> {
...
@@ -238,10 +238,26 @@ public class RainbowPlanController extends BaseController<Object> {
RainbowPlanUser
user
=
userDao
.
findByOpenid
(
openid
);
RainbowPlanUser
user
=
userDao
.
findByOpenid
(
openid
);
if
(
user
!=
null
){
if
(
user
!=
null
){
if
(!
info
.
getFile
().
isEmpty
()){
if
(!
info
.
getFile
().
isEmpty
()){
String
originalFileName
=
info
.
getFile
().
getOriginalFilename
();
//String originalFileName = info.getFile().getOriginalFilename();
//String rootPath = rb.getString("file_path");
//File destFile = new File(rootPath + uploadAvatarPath,originalFileName);
//FileUtils.writeByteArrayToFile(destFile,info.getFile().getBytes());
String
[]
originalFileName
=
info
.
getFile
().
getOriginalFilename
().
split
(
"\\."
);
String
fileName
=
info
.
getUid
()
+
"."
+
originalFileName
[
originalFileName
.
length
-
1
];
String
rootPath
=
rb
.
getString
(
"file_path"
);
String
rootPath
=
rb
.
getString
(
"file_path"
);
File
destFile
=
new
File
(
rootPath
+
uploadAvatarPath
,
originalFileName
);
if
(
StringUtils
.
isNotBlank
(
user
.
getAvatar
()))
{
File
oldFile
=
new
File
(
rootPath
+
user
.
getAvatar
());
FileUtils
.
forceDelete
(
oldFile
);
}
File
destFile
=
new
File
(
rootPath
+
uploadWishImagePath
,
fileName
);
FileUtils
.
writeByteArrayToFile
(
destFile
,
info
.
getFile
().
getBytes
());
FileUtils
.
writeByteArrayToFile
(
destFile
,
info
.
getFile
().
getBytes
());
user
.
setAvatar
(
uploadAvatarPath
+
File
.
separator
+
fileName
);
user
.
setPhone
(
info
.
getPhone
());
user
.
setPhone
(
info
.
getPhone
());
user
.
setName
(
info
.
getName
());
user
.
setName
(
info
.
getName
());
user
.
setNickName
(
info
.
getNickName
());
user
.
setNickName
(
info
.
getNickName
());
...
@@ -251,7 +267,6 @@ public class RainbowPlanController extends BaseController<Object> {
...
@@ -251,7 +267,6 @@ 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
.
setAvatar
(
uploadAvatarPath
+
File
.
separator
+
originalFileName
);
user
.
setDisease
(
info
.
getDisease
());
user
.
setDisease
(
info
.
getDisease
());
userDao
.
update
(
user
);
userDao
.
update
(
user
);
}
else
{
}
else
{
...
...
src/main/java/com/qiankun/controller/rainbowplan/RainbowPlanWebController.java
View file @
edf2b27d
package
com
.
qiankun
.
controller
.
rainbowplan
;
package
com
.
qiankun
.
controller
.
rainbowplan
;
import
java.io.File
;
import
java.util.List
;
import
java.util.List
;
import
java.util.ResourceBundle
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.servlet.ModelAndView
;
import
org.springframework.web.servlet.ModelAndView
;
import
com.qiankun.controller.base.BaseController
;
import
com.qiankun.controller.base.BaseController
;
...
@@ -109,4 +114,73 @@ public class RainbowPlanWebController extends BaseController<Object>{
...
@@ -109,4 +114,73 @@ public class RainbowPlanWebController extends BaseController<Object>{
return
view
;
return
view
;
}
}
@RequestMapping
(
value
=
"/rainbow/wish/save"
,
method
=
RequestMethod
.
POST
)
public
ModelAndView
saveWish
(
@RequestParam
(
value
=
"file"
,
required
=
false
)
MultipartFile
file
,
WishVo
vo
,
HttpServletResponse
response
,
HttpServletRequest
request
)
throws
Exception
{
ModelAndView
view
=
new
ModelAndView
();
String
uploadWishImagePath
=
File
.
separator
+
"rainbowplan"
+
File
.
separator
+
"wishUploadImage"
;
ResourceBundle
rb
=
ResourceBundle
.
getBundle
(
"system"
);
Wish
wish
=
new
Wish
();
if
(
StringUtils
.
isBlank
(
vo
.
getId
()))
{
if
(
file
==
null
)
{
view
.
getModelMap
().
addAttribute
(
"message"
,
"nopic"
);
return
view
;
}
wish
.
setRainbowPlanUserId
(
vo
.
getRainbowPlanUserId
());
wish
.
setActivityId
(
vo
.
getActivityId
());
wish
.
setChildren
(
userDao
.
find
(
vo
.
getRainbowPlanUserId
()));
wish
.
setActivity
(
activityService
.
findById
(
vo
.
getActivityId
()));
wish
.
setVolunteer
(
null
);
view
.
getModelMap
().
addAttribute
(
"status"
,
1
);
}
else
{
wish
=
wishDao
.
find
(
vo
.
getId
());
view
.
getModelMap
().
addAttribute
(
"status"
,
2
);
}
if
(
file
!=
null
)
{
String
fileFullName
=
file
.
getOriginalFilename
();
String
[]
originalFileName
=
fileFullName
.
split
(
"\\."
);
String
fileName
=
vo
.
getCode
()
+
"."
+
originalFileName
[
originalFileName
.
length
-
1
];
String
rootPath
=
rb
.
getString
(
"file_path"
);
if
(
StringUtils
.
isNotBlank
(
wish
.
getUploadImage
()))
{
File
oldFile
=
new
File
(
rootPath
+
wish
.
getUploadImage
());
if
(
oldFile
.
isFile
())
FileUtils
.
forceDelete
(
oldFile
);
}
File
destFile
=
new
File
(
rootPath
+
uploadWishImagePath
,
fileName
);
FileUtils
.
writeByteArrayToFile
(
destFile
,
file
.
getBytes
());
wish
.
setUploadImage
(
uploadWishImagePath
+
File
.
separator
+
fileName
);
}
wish
.
setStatus
(
vo
.
getStatus
());
wish
.
setCode
(
vo
.
getCode
());
wish
.
setTitle
(
vo
.
getTitle
());
wish
.
setContent
(
vo
.
getContent
());
if
(
vo
.
getReset
()
!=
null
&&
vo
.
getReset
())
{
wish
.
setVolunteer
(
null
);
wish
.
setExpressCode
(
null
);
wish
.
setExpressCompany
(
null
);
wish
.
setHelpType
(
0
);
}
wishDao
.
save
(
wish
);
return
view
;
}
}
}
src/main/java/com/qiankun/dao/WishDaoImpl.java
View file @
edf2b27d
...
@@ -38,7 +38,12 @@ public class WishDaoImpl extends AbsDao<Wish,String> implements WishDao {
...
@@ -38,7 +38,12 @@ public class WishDaoImpl extends AbsDao<Wish,String> implements WishDao {
@Override
@Override
public
IPageList
<
Wish
>
findPages
(
String
searchStr
,
String
activityId
,
Integer
status
,
String
order
,
String
sort
,
Hints
hints
)
{
public
IPageList
<
Wish
>
findPages
(
String
searchStr
,
String
activityId
,
Integer
status
,
String
order
,
String
sort
,
Hints
hints
)
{
if
(
order
==
null
){
order
=
" createTime "
;
}
if
(
sort
==
null
){
sort
=
" desc "
;
}
String
hql
=
""
;
String
hql
=
""
;
if
(
StringUtils
.
isNotBlank
(
searchStr
))
{
if
(
StringUtils
.
isNotBlank
(
searchStr
))
{
if
(
StringUtils
.
isBlank
(
hql
))
{
if
(
StringUtils
.
isBlank
(
hql
))
{
...
...
src/main/java/com/qiankun/vo/WishVo.java
View file @
edf2b27d
...
@@ -2,11 +2,14 @@ package com.qiankun.vo;
...
@@ -2,11 +2,14 @@ package com.qiankun.vo;
import
java.util.Date
;
import
java.util.Date
;
import
org.springframework.web.multipart.MultipartFile
;
import
com.qiankun.entity.RainbowPlanUser
;
import
com.qiankun.entity.RainbowPlanUser
;
public
class
WishVo
{
public
class
WishVo
{
private
String
id
;
//愿望ID
private
String
id
;
//愿望ID
private
String
code
;
//愿望编号
private
String
title
;
//愿望标题
private
String
title
;
//愿望标题
private
String
content
;
//愿望内容
private
String
content
;
//愿望内容
private
String
uploadImage
;
//上传的图片
private
String
uploadImage
;
//上传的图片
...
@@ -26,6 +29,8 @@ public class WishVo {
...
@@ -26,6 +29,8 @@ public class WishVo {
private
String
order
;
private
String
order
;
private
String
sort
;
private
String
sort
;
private
Boolean
reset
=
false
;
public
Date
getCreateTime
()
{
public
Date
getCreateTime
()
{
return
createTime
;
return
createTime
;
}
}
...
@@ -161,6 +166,22 @@ public class WishVo {
...
@@ -161,6 +166,22 @@ public class WishVo {
public
void
setSort
(
String
sort
)
{
public
void
setSort
(
String
sort
)
{
this
.
sort
=
sort
;
this
.
sort
=
sort
;
}
}
public
Boolean
getReset
()
{
return
reset
;
}
public
void
setReset
(
Boolean
reset
)
{
this
.
reset
=
reset
;
}
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
...
...
src/main/resources/system.properties
View file @
edf2b27d
#
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
...
...
src/main/webapp/WEB-INF/pages/rainbow/userlist.jsp
View file @
edf2b27d
...
@@ -181,4 +181,4 @@
...
@@ -181,4 +181,4 @@
activityHTML += '</select><button class="btn-xs" onclick="user.validateWish()">确定</button></div>';
activityHTML += '</select><button class="btn-xs" onclick="user.validateWish()">确定</button></div>';
</script>
</script>
<script src="<webpath:path/>/resources/js/rainbow/rainbowuser.js" type="text/javascript"></script>
<script src="<webpath:path/>/resources/js/rainbow/rainbowuser.js?v=window.number" type="text/javascript"></script>
\ No newline at end of file
\ No newline at end of file
src/main/webapp/WEB-INF/pages/rainbow/wishlist.jsp
View file @
edf2b27d
...
@@ -47,7 +47,7 @@
...
@@ -47,7 +47,7 @@
</div>
</div>
<div class="pull-right">
<div class="pull-right">
<select class="" id="activity
Id" name="activityId
">
<select class="" id="activity
" name="activity
">
<option value="">请选择活动</option>
<option value="">请选择活动</option>
<c:forEach var="list" items="${activitylist}">
<c:forEach var="list" items="${activitylist}">
<option value="${list.id}" <c:if test="${wishVo.activityId==list.id}">selected</c:if>>${list.name}</option>
<option value="${list.id}" <c:if test="${wishVo.activityId==list.id}">selected</c:if>>${list.name}</option>
...
@@ -76,7 +76,7 @@
...
@@ -76,7 +76,7 @@
<span class="lbl"></span>
<span class="lbl"></span>
</label>
</label>
</th>
</th>
<th width="">图片</th>
<th width="
70
">图片</th>
<th width="">小朋友</th>
<th width="">小朋友</th>
<th width="10%">愿望</th>
<th width="10%">愿望</th>
<th width="20%">内容</th>
<th width="20%">内容</th>
...
@@ -86,7 +86,7 @@
...
@@ -86,7 +86,7 @@
<th width="">所属活动</th>
<th width="">所属活动</th>
<th width="">状态</th>
<th width="">状态</th>
<th width="5%">发布时间</th>
<th width="5%">发布时间</th>
<
!-- <th width="5%">操作</th> --
>
<
th width="2%">操作</th
>
</tr>
</tr>
</thead>
</thead>
...
@@ -101,11 +101,13 @@
...
@@ -101,11 +101,13 @@
</td>
</td>
<td title="" valign="middle"><a href="#"><img alt="" src="<webpath:path/>/wx/rainbowplan/loadResource?imageName=${wish.uploadImage}" width="60" height="60"/></a></td>
<td title="" valign="middle"><a href="#"><img alt="" src="<webpath:path/>/wx/rainbowplan/loadResource?imageName=${wish.uploadImage}" width="60" height="60"/></a></td>
<td title="">姓名:${wish.children.name} 楼层床号:${wish.children.bedNum}<br/>
<td title="">姓名:${wish.children.name} 楼层床号:${wish.children.bedNum}<br/>
联系方式:${wish.children.phone
}<br/>
收件人:${wish.children.receiveName} 联系方式:${wish.children.connectTel
}<br/>
收件地址:${wish.children.receiveAddress};
收件地址:${wish.children.receiveAddress};
</td>
</td>
<td title="" valign="middle">${wish.title}</td>
<td title="" valign="middle">
编号:${wish.code}<br>
愿望:${wish.title}</td>
<td title="" valign="middle"><div class="slim-scroll" style="overflow: hidden; width: auto; height: 65px;">${wish.content}</div></td>
<td title="" valign="middle"><div class="slim-scroll" style="overflow: hidden; width: auto; height: 65px;">${wish.content}</div></td>
<td title="" valign="middle">
<td title="" valign="middle">
<c:if test="${wish.volunteer != null}">姓名:${wish.volunteer.name}<br/>
<c:if test="${wish.volunteer != null}">姓名:${wish.volunteer.name}<br/>
...
@@ -127,23 +129,23 @@
...
@@ -127,23 +129,23 @@
<td title="" valign="middle"><fmt:formatDate value='${wish.createTime}' pattern='yyyy-MM-dd HH:mm' /></td>
<td title="" valign="middle"><fmt:formatDate value='${wish.createTime}' pattern='yyyy-MM-dd HH:mm' /></td>
<
%-- <
td>
<td>
<div class="visible-md visible-lg hidden-sm hidden-xs btn-group">
<div class="visible-md visible-lg hidden-sm hidden-xs btn-group">
<button class="btn btn-xs btn-info" onclick="window.location.href='<webpath:path/>/rainbow/
user/add?id=${user
.id}'">
<button class="btn btn-xs btn-info" onclick="window.location.href='<webpath:path/>/rainbow/
wish/view?id=${wish
.id}'">
<i class="icon-
credit-card
bigger-120"></i>
<i class="icon-
edit
bigger-120"></i>
</button>
</button>
<a class="btn btn-xs btn-link" title="详细信息" href="<webpath:path/>/rainbow/wish/view?id=${wish.id}">
<
%-- <
a class="btn btn-xs btn-link" title="详细信息" href="<webpath:path/>/rainbow/wish/view?id=${wish.id}">
<i class="icon-list-alt bigger-120"></i>
<i class="icon-list-alt bigger-120"></i>
</a>
</a>
--%>
</div>
</div>
</td>
--%>
</td>
</tr>
</tr>
</c:forEach>
</c:forEach>
</tbody>
</tbody>
...
...
src/main/webapp/WEB-INF/pages/rainbow/wishview.jsp
View file @
edf2b27d
This diff is collapsed.
Click to expand it.
src/main/webapp/resources/js/rainbow/rainbowuser.js
View file @
edf2b27d
...
@@ -41,6 +41,10 @@ var user = {
...
@@ -41,6 +41,10 @@ var user = {
userId
:
""
,
userId
:
""
,
validateWish
:
function
(){
validateWish
:
function
(){
var
activityId
=
$
(
"#activityId"
).
val
()
var
activityId
=
$
(
"#activityId"
).
val
()
if
(
activityId
==
""
){
$
(
"#message"
).
html
(
"请选择活动!"
);
return
;
}
$
.
ajax
({
$
.
ajax
({
type
:
'POST'
,
type
:
'POST'
,
url
:
'/rainbow/wish/validate'
,
url
:
'/rainbow/wish/validate'
,
...
...
src/main/webapp/resources/js/rainbow/wish.js
View file @
edf2b27d
var
isSubmit
=
true
;
$
(
document
).
ready
(
function
(){
$
(
document
).
ready
(
function
(){
$
(
"#activity
Id
"
).
select2
({
$
(
"#activity"
).
select2
({
placeholder
:
"请选择"
,
placeholder
:
"请选择"
,
allowClear
:
true
allowClear
:
true
});
});
...
@@ -11,13 +12,48 @@ $(document).ready(function(){
...
@@ -11,13 +12,48 @@ $(document).ready(function(){
railVisible
:
true
railVisible
:
true
});
});
});
});
/*if ($('#wish_form').length>0){
$('#wish_form').validate({
rules : {
"title" : {
required : true
},
"content" : {
required : true
}
},
messages:{
"title" : {
required : "不能为空"
},
"content" : {
required : "不能为空"
}
},
submitHandler: function(form){
wish.save();
}
});
}*/
})
})
var
wish
=
{
var
wish
=
{
search
:
function
(){
search
:
function
(){
var
activityId
=
$
(
"#activity
Id
"
).
val
();
var
activityId
=
$
(
"#activity"
).
val
();
var
searchStr
=
$
(
"#searchStr"
).
val
();
var
searchStr
=
$
(
"#searchStr"
).
val
();
var
status
=
$
(
"#status"
).
val
();
var
status
=
$
(
"#status"
).
val
();
var
url
=
webPath
+
"/rainbow/wish/list"
;
var
url
=
webPath
+
"/rainbow/wish/list"
;
...
@@ -137,6 +173,94 @@ var wish = {
...
@@ -137,6 +173,94 @@ var wish = {
});
});
}
}
})
})
},
save
:
function
(
form
){
if
(
isSubmit
){
isSubmit
=
false
;
var
formData
=
new
FormData
();
formData
.
append
(
'file'
,
$
(
'#input_file'
)[
0
].
files
[
0
]);
formData
.
append
(
'id'
,
$
(
'#id'
).
val
());
formData
.
append
(
'code'
,
$
(
'#code'
).
val
());
formData
.
append
(
'activityId'
,
$
(
'#activityId'
).
val
());
formData
.
append
(
'rainbowPlanUserId'
,
$
(
'#rainbowPlanUserId'
).
val
());
formData
.
append
(
'title'
,
$
(
'#title'
).
val
());
formData
.
append
(
'content'
,
$
(
'#content'
).
val
());
formData
.
append
(
'status'
,
$
(
'#status'
).
val
());
//console.info($('#reset'));
//alert(typeof($('#reset').val()) != "undefined");
if
(
typeof
(
$
(
'#reset'
).
val
())
!=
"undefined"
){
formData
.
append
(
'reset'
,
$
(
'#reset'
).
val
());
}
$
.
ajax
({
url
:
webPath
+
"/rainbow/wish/save"
,
type
:
'POST'
,
cache
:
false
,
data
:
formData
,
processData
:
false
,
contentType
:
false
,
dataType
:
"json"
,
beforeSend
:
function
(){
},
success
:
function
(
data
)
{
isSubmit
=
true
;
var
status
=
data
.
status
;
var
message
=
data
.
message
;
if
(
message
==
"nopic"
){
bootbox
.
dialog
({
message
:
"请上传图片"
,
buttons
:{
"success"
:{
"label"
:
"确定"
,
"className"
:
"btn-sm btn-primary"
,
"callback"
:
function
()
{
}
}
}
});
}
if
(
status
==
1
){
bootbox
.
dialog
({
message
:
"保存成功"
,
buttons
:{
"success"
:{
"label"
:
"确定"
,
"className"
:
"btn-sm btn-primary"
,
"callback"
:
function
()
{
history
.
go
(
-
1
);
}
}
}
});
}
if
(
status
==
2
){
bootbox
.
dialog
({
message
:
"修改成功"
,
buttons
:{
"success"
:{
"label"
:
"确定"
,
"className"
:
"btn-sm btn-primary"
,
"callback"
:
function
()
{
window
.
location
.
reload
();
}
}
}
});
}
}
})
}
}
}
...
...
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