Commit bf9321cc authored by liuchao's avatar liuchao

no message

parent db2eff32
...@@ -58,7 +58,7 @@ public class RainbowPlanWebController extends BaseController<Object>{ ...@@ -58,7 +58,7 @@ public class RainbowPlanWebController extends BaseController<Object>{
private ActivityService activityService; private ActivityService activityService;
@RequestMapping("/rainbow/user/view") @RequestMapping("/rainbow/user/view")
public ModelAndView useradd(String id, HttpServletResponse response, HttpServletRequest request) throws Exception { public ModelAndView userAdd(String id, HttpServletResponse response, HttpServletRequest request) throws Exception {
ModelAndView view = new ModelAndView(); ModelAndView view = new ModelAndView();
RainbowPlanUser user = new RainbowPlanUser(); RainbowPlanUser user = new RainbowPlanUser();
if(StringUtils.isNotBlank(id)) { if(StringUtils.isNotBlank(id)) {
...@@ -107,23 +107,38 @@ public class RainbowPlanWebController extends BaseController<Object>{ ...@@ -107,23 +107,38 @@ public class RainbowPlanWebController extends BaseController<Object>{
FileUtils.writeByteArrayToFile(destFile,file.getBytes()); FileUtils.writeByteArrayToFile(destFile,file.getBytes());
user.setAvatar(uploadImagePath + File.separator + fileName); user.setAvatar(uploadImagePath + File.separator + fileName);
} }
user.setBedNum(vo.getBedNum());
user.setBirthday(vo.getBirthday());
user.setConnectTel(vo.getConnectTel());
user.setDisease(vo.getDisease());
user.setGender(vo.getGender());
user.setName(vo.getName()); user.setName(vo.getName());
user.setNickName(vo.getNickName()); user.setConnectTel(vo.getConnectTel());
user.setPhone(vo.getPhone()); user.setPhone(vo.getPhone());
user.setReceiveAddress(vo.getReceiveAddress()); user.setReceiveAddress(vo.getReceiveAddress());
user.setReceiveName(vo.getReceiveName()); user.setReceiveName(vo.getReceiveName());
user.setStatus(vo.getStatus());
if (user.getType() == 0) {
user.setBedNum(vo.getBedNum());
user.setBirthday(vo.getBirthday());
user.setDisease(vo.getDisease());
user.setGender(vo.getGender());
user.setNickName(vo.getNickName());
user.setStatus(vo.getStatus());
}
userDao.save(user); userDao.save(user);
return view; return view;
} }
@RequestMapping("/rainbow/user/del")
public ModelAndView userDelete(String id, HttpServletResponse response, HttpServletRequest request) throws Exception {
ModelAndView view = new ModelAndView();
if(StringUtils.isNotBlank(id)) {
RainbowPlanUser user = userDao.find(id);
user.setRemove(true);
userDao.save(user);
view.getModelMap().addAttribute("status", "success");
}
return view;
}
@RequestMapping("/rainbow/user/list") @RequestMapping("/rainbow/user/list")
public ModelAndView userlist(RainbowPlanUserVo userVo,HttpServletResponse response, HttpServletRequest request) throws Exception { public ModelAndView userlist(RainbowPlanUserVo userVo,HttpServletResponse response, HttpServletRequest request) throws Exception {
......
...@@ -15,7 +15,7 @@ import com.qiankun.pages.PageListImpl; ...@@ -15,7 +15,7 @@ import com.qiankun.pages.PageListImpl;
@Repository @Repository
public class RainbowPlanUserDaoImpl extends AbsDao<RainbowPlanUser,String> implements RainbowPlanUserDao { public class RainbowPlanUserDaoImpl extends AbsDao<RainbowPlanUser,String> implements RainbowPlanUserDao {
private static final String FIND_USER_PAGE = " from RainbowPlanUser where (phone like ? or disease like ? or name like ? or nickName like ?) "; private static final String FIND_USER_PAGE = " from RainbowPlanUser where (remove=false or remove is null) and (phone like ? or disease like ? or name like ? or nickName like ?) ";
@Override @Override
public RainbowPlanUser findByOpenid(String openid) { public RainbowPlanUser findByOpenid(String openid) {
......
...@@ -60,6 +60,7 @@ ...@@ -60,6 +60,7 @@
</div> </div>
</div> </div>
<c:if test="${user.type==0}">
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> <!--font color="red">*</font--> 昵称 </label> <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> <!--font color="red">*</font--> 昵称 </label>
...@@ -67,29 +68,30 @@ ...@@ -67,29 +68,30 @@
<input type="text" id="nickName" name="nickName" value="${user.nickName}" class="col-xs-10 col-sm-10" /> <input type="text" id="nickName" name="nickName" value="${user.nickName}" class="col-xs-10 col-sm-10" />
</div> </div>
</div> </div>
</c:if>
<c:if test="${user.type==0}">
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for="form-field-2"> 性别 </label> <label class="col-sm-3 control-label no-padding-right" for="form-field-2"> 性别 </label>
<div class="col-sm-9"> <div class="col-sm-9">
<label> <label>
<input name="gender" type="radio" class="ace" value="1" <c:if test="${user.gender=='1'}">checked</c:if>> <input name="gender" type="radio" class="ace" value="1" <c:if test="${user.gender=='1'}">checked</c:if>>
<span class="lbl"> 男</span> <span class="lbl"> 男</span>
</label> </label>
<label> <label>
<input name="gender" type="radio" class="ace" value="2" <c:if test="${user.gender=='2'}">checked</c:if>> <input name="gender" type="radio" class="ace" value="2" <c:if test="${user.gender=='2'}">checked</c:if>>
<span class="lbl"> 女</span> <span class="lbl"> 女</span>
</label> </label>
</div> </div>
</div> </div>
</c:if>
<c:if test="${user.type==0}">
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for="form-input-readonly"> <!--font color="red">*</font--> 出生日期 </label> <label class="col-sm-3 control-label no-padding-right" for="form-input-readonly"> <!--font color="red">*</font--> 出生日期 </label>
...@@ -98,11 +100,11 @@ ...@@ -98,11 +100,11 @@
</div> </div>
</div> </div>
</c:if>
<c:if test="${user.type==0}">
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for="form-input-readonly"> <!--font color="red">*</font--> 楼层床号 </label> <label class="col-sm-3 control-label no-padding-right" for="form-input-readonly"> <!--font color="red">*</font--> 楼层床号 </label>
...@@ -111,9 +113,11 @@ ...@@ -111,9 +113,11 @@
</div> </div>
</div> </div>
</c:if>
<c:if test="${user.type==0}">
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for="form-input-readonly"> 疾病 </label> <label class="col-sm-3 control-label no-padding-right" for="form-input-readonly"> 疾病 </label>
...@@ -121,6 +125,8 @@ ...@@ -121,6 +125,8 @@
<input type="text" id="disease" name="disease" value="${user.disease}" class="col-xs-10 col-sm-10" /> <input type="text" id="disease" name="disease" value="${user.disease}" class="col-xs-10 col-sm-10" />
</div> </div>
</div> </div>
</c:if>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> <!--font color="red">*</font--> 收件人姓名</label> <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> <!--font color="red">*</font--> 收件人姓名</label>
...@@ -148,7 +154,7 @@ ...@@ -148,7 +154,7 @@
</div> </div>
</div> </div>
<c:if test="${user.type==0}">
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 用户状态</label> <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 用户状态</label>
...@@ -161,7 +167,7 @@ ...@@ -161,7 +167,7 @@
</div> </div>
</div> </div>
</c:if>
<div class="form-group"> <div class="form-group">
...@@ -217,4 +223,8 @@ ...@@ -217,4 +223,8 @@
</div> </div>
<script src="<webpath:path/>/resources/js/rainbow/rainbowuser.js" type="text/javascript"></script> <script src="<webpath:path/>/resources/js/rainbow/rainbowuser.js" type="text/javascript"></script>
\ No newline at end of file <script>
user.type = ${user.type};
</script>
...@@ -55,9 +55,9 @@ ...@@ -55,9 +55,9 @@
<th width="7%">疾病</th> <th width="7%">疾病</th>
<th width="6%">收件人</th> <th width="6%">收件人</th>
<th width="6%">联系方式</th> <th width="6%">联系方式</th>
<th width="22%">收件地址</th> <th width="20%">收件地址</th>
<th width="8%">注册时间</th> <th width="8%">注册时间</th>
<th width="5%">操作</th> <th width="7%">操作</th>
</tr> </tr>
</thead> </thead>
...@@ -84,16 +84,18 @@ ...@@ -84,16 +84,18 @@
<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" title="修改" onclick="window.location.href='<webpath:path/>/rainbow/user/view?id=${user.id}'">
<i class="icon-edit bigger-120"></i>
</button>
&nbsp;
<button class="btn btn-xs btn-success" title="添加愿望" onclick="user.openlayer('${user.id}','${user.name}')"> <button class="btn btn-xs btn-success" title="添加愿望" onclick="user.openlayer('${user.id}','${user.name}')">
<i class="icon-lightbulb bigger-120"></i> <i class="icon-lightbulb"></i>
</button>&nbsp;
<button class="btn btn-xs btn-info" title="修改" onclick="window.location.href='<webpath:path/>/rainbow/user/view?id=${user.id}'">
<i class="icon-edit"></i>
</button>
&nbsp;
<button class="btn btn-xs btn-danger" title="删除" onclick="user.del('${user.id}')">
<i class="icon-trash"></i>
</button> </button>
</div> </div>
...@@ -111,6 +113,7 @@ ...@@ -111,6 +113,7 @@
<table id="table-data" class="table table-bordered "> <table id="table-data" class="table table-bordered ">
<thead> <thead>
<tr class=""> <tr class="">
<th width="5%">照片</th>
<th width="6%">注册手机</th> <th width="6%">注册手机</th>
<th width="6%">姓名</th> <th width="6%">姓名</th>
<th width="6%">收件人</th> <th width="6%">收件人</th>
...@@ -123,26 +126,25 @@ ...@@ -123,26 +126,25 @@
<tbody> <tbody>
<c:forEach var="user" items="${userPage.records}"> <c:forEach var="user" items="${userPage.records}">
<tr class="tr-highlight"> <tr class="tr-highlight">
<td title=""><c:if test="${user.avatar!=null&&user.avatar!=''}"><img alt="" src="<webpath:path/>/wx/rainbowplan/loadResource?imageName=${user.avatar}" width="60" height="60"/></c:if></td>
<td title="">${user.phone}</td> <td title="">${user.phone}</td>
<td title="">${user.name}</td> <td title="">${user.name}</td>
<td title="">${user.receiveName}</td> <td title="">${user.receiveName}</td>
<td title="">${user.connectTel}</td> <td title="">${user.connectTel}</td>
<td title="">${user.receiveAddress}</td> <td title="">${user.receiveAddress}</td>
<td title="">${user.createTime}</td> <td title=""><fmt:formatDate value='${user.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" title="修改" onclick="window.location.href='<webpath:path/>/rainbow/user/view?id=${user.id}'">
<i class="icon-credit-card bigger-120"></i> <i class="icon-edit"></i>
</button> </button>
&nbsp; --%>
<!-- <button class="btn btn-xs btn-danger" > &nbsp;
<i class="icon-trash bigger-120"></i> <button class="btn btn-xs btn-danger" title="删除" onclick="user.del('${user.id}')">
</button> --> <i class="icon-trash"></i>
</button>
</div> </div>
......
...@@ -44,6 +44,7 @@ $(document).ready(function(){ ...@@ -44,6 +44,7 @@ $(document).ready(function(){
var user = { var user = {
type : "",
children : function(){ children : function(){
var url = webPath + "/rainbow/user/list?type=0"; var url = webPath + "/rainbow/user/list?type=0";
user.search(url); user.search(url);
...@@ -113,15 +114,20 @@ var user = { ...@@ -113,15 +114,20 @@ var user = {
formData.append('id', $('#id').val()); formData.append('id', $('#id').val());
formData.append('phone', $('#phone').val()); formData.append('phone', $('#phone').val());
formData.append('name', $('#name').val()); formData.append('name', $('#name').val());
formData.append('nickName', $('#nickName').val());
formData.append('gender', $('input:radio[name="gender"]:checked').val());
formData.append('birthday', $('#birthday').val());
formData.append('bedNum', $('#bedNum').val());
formData.append('disease', $('#disease').val());
formData.append('receiveName', $('#receiveName').val()); formData.append('receiveName', $('#receiveName').val());
formData.append('connectTel', $('#connectTel').val()); formData.append('connectTel', $('#connectTel').val());
formData.append('receiveAddress', $('#receiveAddress').val()); formData.append('receiveAddress', $('#receiveAddress').val());
formData.append('status', $('#status').val());
alert(user.type)
if(user.type == 0){
formData.append('nickName', $('#nickName').val());
formData.append('gender', $('input:radio[name="gender"]:checked').val());
formData.append('birthday', $('#birthday').val());
formData.append('bedNum', $('#bedNum').val());
formData.append('disease', $('#disease').val());
formData.append('status', $('#status').val());
}
...@@ -193,6 +199,37 @@ var user = { ...@@ -193,6 +199,37 @@ var user = {
} }
}) })
} }
},
del : function(id) {
bootbox.confirm({
buttons: {
cancel: {
label: '取消',
className: 'btn-default'
},
confirm: {
label: '确认',
className: 'btn-myStyle'
}
},
message: '请确认是否删除?',
callback: function(result) {
if(result) {
$.ajax({
type: 'GET',
url: webPath + '/rainbow/user/del?id='+id,
dataType:'json',
success: function(data){
window.location.reload();
}
})
} else {
}
},
//title: "bootbox confirm也可以添加标题哦",
});
} }
......
...@@ -156,7 +156,10 @@ var wish = { ...@@ -156,7 +156,10 @@ var wish = {
buttons:{ buttons:{
"success":{ "success":{
"label":"OK", "label":"OK",
"className":"btn-sm btn-primary" "className":"btn-sm btn-primary",
"callback": function () {
wish.isSearch = false;
}
} }
} }
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment