Commit f532b248 by Huang Linyu

会员管理系统-标签功能开发

parent 8b6ed155
...@@ -2,6 +2,7 @@ package com.ctrip.fun.admin.controller.market; ...@@ -2,6 +2,7 @@ package com.ctrip.fun.admin.controller.market;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
...@@ -19,12 +20,16 @@ import org.springframework.web.bind.annotation.ResponseStatus; ...@@ -19,12 +20,16 @@ import org.springframework.web.bind.annotation.ResponseStatus;
import com.ctrip.fun.admin.form.PaginationForm; import com.ctrip.fun.admin.form.PaginationForm;
import com.ctrip.fun.admin.service.market.CommuneAdmService; import com.ctrip.fun.admin.service.market.CommuneAdmService;
import com.ctrip.fun.admin.service.market.CommuneExtService;
import com.ctrip.fun.admin.utility.SpringSecurityUtil;
import com.ctrip.fun.common.vo.PagedResponseBean; import com.ctrip.fun.common.vo.PagedResponseBean;
import com.ctrip.fun.common.vo.Response; import com.ctrip.fun.common.vo.Response;
import com.ctrip.fun.common.vo.ResponseStatusEnum; import com.ctrip.fun.common.vo.ResponseStatusEnum;
import com.ctrip.fun.common.vo.product.CourseResourcePaymentBean; import com.ctrip.fun.common.vo.product.CourseResourcePaymentBean;
import com.ctrip.fun.common.vo.user.CommuneAdmBean; import com.ctrip.fun.common.vo.user.CommuneAdmBean;
import com.ctrip.fun.common.vo.user.CommuneAdmQuery; import com.ctrip.fun.common.vo.user.CommuneAdmQuery;
import com.ctrip.fun.common.vo.user.CommuneExtBean;
import com.ctrip.fun.common.vo.user.CommuneLabelBean;
@Controller @Controller
@RequestMapping("/communeAdm") @RequestMapping("/communeAdm")
...@@ -32,6 +37,8 @@ public class CommuneAdmController { ...@@ -32,6 +37,8 @@ public class CommuneAdmController {
@Autowired @Autowired
private CommuneAdmService communeAdmService; private CommuneAdmService communeAdmService;
@Autowired
private CommuneExtService communeExtService;
@RequestMapping(value = "queryList", method = RequestMethod.GET) @RequestMapping(value = "queryList", method = RequestMethod.GET)
public String queryList(HttpServletRequest request, @ModelAttribute("dto") CommuneAdmQuery query, ModelMap model) { public String queryList(HttpServletRequest request, @ModelAttribute("dto") CommuneAdmQuery query, ModelMap model) {
...@@ -48,16 +55,53 @@ public class CommuneAdmController { ...@@ -48,16 +55,53 @@ public class CommuneAdmController {
total = response.getCount(); total = response.getCount();
pageCount = (0 == total % pageSize) ? (total / pageSize) : (total / pageSize + 1); pageCount = (0 == total % pageSize) ? (total / pageSize) : (total / pageSize + 1);
// for (CommuneExtBean bean : response.getResult()) {
// bean.setCommuneAgainTime(DateUtil.addDateField(bean.getCommuneAgainTime(), Calendar.YEAR, 1)); //到期时间
// }
model.put("list", response.getResult()); model.put("list", response.getResult());
model.put("paginationData", new PaginationForm(currentPage, pageSize, pageCount, total)); model.put("paginationData", new PaginationForm(currentPage, pageSize, pageCount, total));
return "market/communeAdm/list"; return "market/communeAdm/list";
} }
@RequestMapping(value = "myBindList", method = RequestMethod.GET)
public String myBindList(HttpServletRequest request, @ModelAttribute("dto") CommuneAdmQuery query, ModelMap model) {
int currentPage = 0;
int pageSize;
int total;
int pageCount;
if (null != request.getParameter("page")) {
currentPage = Integer.parseInt(request.getParameter("page"));
}
String username = SpringSecurityUtil.getCurrentUserName();
query.setBindedAdm(username);
/*String label = query.getLabels();
if(label!=null){
query.setLabels(" "+label+" ");
}*/
query.setPagerOffset(currentPage * query.getPagerPerPage());
PagedResponseBean<CommuneAdmBean> response = communeAdmService.myBindList(query);
pageSize = query.getPagerPerPage();
total = response.getCount();
pageCount = (0 == total % pageSize) ? (total / pageSize) : (total / pageSize + 1);
List<CommuneLabelBean> labelsList = communeAdmService.findAllLabels();
model.put("labelsList", labelsList);
model.put("list", response.getResult());
model.put("paginationData", new PaginationForm(currentPage, pageSize, pageCount, total));
return "market/communeAdm/myBindList";
}
/*@RequestMapping(value = "update", method = RequestMethod.GET)
public String toUpdate(HttpServletRequest request, @ModelAttribute("id") Integer id, ModelMap model) {
CommuneExtBean bean = communeExtService.getById(id);
CommuneAdmBean admBean = communeAdmService.getByCommuneExtId(id);
model.put("dto", bean);
model.put("labels", admBean.getLabels());
model.put("action", "/communeExt/update");
model.put("page", request.getParameter("page"));
return "market/communeExt/form";
}*/
/** /**
* 批量绑定管理员 * 批量绑定管理员
*/ */
...@@ -90,4 +134,12 @@ public class CommuneAdmController { ...@@ -90,4 +134,12 @@ public class CommuneAdmController {
return response; return response;
} }
@ResponseBody
@RequestMapping(value = "/labels/list", method = RequestMethod.GET)
public List<CommuneLabelBean> findAllLabels() {
List<CommuneLabelBean> labelsList = communeAdmService.findAllLabels();
return labelsList;
}
} }
...@@ -7,6 +7,7 @@ import java.net.URL; ...@@ -7,6 +7,7 @@ import java.net.URL;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.List;
import javax.servlet.ServletOutputStream; import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
...@@ -27,6 +28,7 @@ import org.springframework.web.multipart.MultipartFile; ...@@ -27,6 +28,7 @@ import org.springframework.web.multipart.MultipartFile;
import com.ctrip.fun.admin.form.PaginationForm; import com.ctrip.fun.admin.form.PaginationForm;
import com.ctrip.fun.admin.form.excel.AbstractExcelQuery; import com.ctrip.fun.admin.form.excel.AbstractExcelQuery;
import com.ctrip.fun.admin.service.market.CommuneAdmService;
import com.ctrip.fun.admin.service.market.CommuneExtExcelService; import com.ctrip.fun.admin.service.market.CommuneExtExcelService;
import com.ctrip.fun.admin.service.market.CommuneExtService; import com.ctrip.fun.admin.service.market.CommuneExtService;
import com.ctrip.fun.admin.service.system.UserDetailsService; import com.ctrip.fun.admin.service.system.UserDetailsService;
...@@ -35,10 +37,14 @@ import com.ctrip.fun.admin.utility.SpringSecurityUtil; ...@@ -35,10 +37,14 @@ import com.ctrip.fun.admin.utility.SpringSecurityUtil;
import com.ctrip.fun.common.core.util.DateUtil; import com.ctrip.fun.common.core.util.DateUtil;
import com.ctrip.fun.common.core.util.StringUtils; import com.ctrip.fun.common.core.util.StringUtils;
import com.ctrip.fun.common.vo.PagedResponseBean; import com.ctrip.fun.common.vo.PagedResponseBean;
import com.ctrip.fun.common.vo.Response;
import com.ctrip.fun.common.vo.basic.EntityImageBean; import com.ctrip.fun.common.vo.basic.EntityImageBean;
import com.ctrip.fun.common.vo.basic.GenderEnum; import com.ctrip.fun.common.vo.basic.GenderEnum;
import com.ctrip.fun.common.vo.user.CommuneAdmBean;
import com.ctrip.fun.common.vo.user.CommuneAdmQuery;
import com.ctrip.fun.common.vo.user.CommuneExtBean; import com.ctrip.fun.common.vo.user.CommuneExtBean;
import com.ctrip.fun.common.vo.user.CommuneExtQuery; import com.ctrip.fun.common.vo.user.CommuneExtQuery;
import com.ctrip.fun.common.vo.user.CommuneLabelBean;
import com.ctrip.fun.common.vo.user.CommunePhotoStateEnum; import com.ctrip.fun.common.vo.user.CommunePhotoStateEnum;
import com.ctrip.fun.common.vo.user.UserExtBean; import com.ctrip.fun.common.vo.user.UserExtBean;
...@@ -57,6 +63,8 @@ public class CommuneExtConttroller { ...@@ -57,6 +63,8 @@ public class CommuneExtConttroller {
private UserService userExtService ; private UserService userExtService ;
@Autowired @Autowired
private CommuneAdmService communeAdmService;
@Autowired
private CommuneExtExcelService communeExtExcelService; private CommuneExtExcelService communeExtExcelService;
/** /**
* 公社会员扩展信息 * 公社会员扩展信息
...@@ -118,12 +126,17 @@ public class CommuneExtConttroller { ...@@ -118,12 +126,17 @@ public class CommuneExtConttroller {
} }
dto.setCreatedTime(new Date()); dto.setCreatedTime(new Date());
boolean success = communeExtService.add(SpringSecurityUtil.getCurrentUserName(), dto); Integer success = communeExtService.insert(SpringSecurityUtil.getCurrentUserName(), dto);
if (!success) { if (success==null) {
model.put("exceptionMsg", "新增失败!"); model.put("exceptionMsg", "新增失败!");
model.put("action", "/communeExt/create"); model.put("action", "/communeExt/create");
model.put("page", request.getParameter("page")); model.put("page", request.getParameter("page"));
return "market/communeExt/form"; return "market/communeExt/form";
}else{
CommuneAdmQuery admQuery = new CommuneAdmQuery();
admQuery.setCommuneExtId(success);
admQuery.setLabels(dto.getLabels());
communeAdmService.updateLabels(admQuery);
} }
return "redirect:queryList"; return "redirect:queryList";
} }
...@@ -131,6 +144,12 @@ public class CommuneExtConttroller { ...@@ -131,6 +144,12 @@ public class CommuneExtConttroller {
@RequestMapping(value = "update", method = RequestMethod.GET) @RequestMapping(value = "update", method = RequestMethod.GET)
public String toUpdate(HttpServletRequest request, @ModelAttribute("id") Integer id, ModelMap model) { public String toUpdate(HttpServletRequest request, @ModelAttribute("id") Integer id, ModelMap model) {
CommuneExtBean bean = communeExtService.getById(id); CommuneExtBean bean = communeExtService.getById(id);
CommuneAdmBean admBean = communeAdmService.getByCommuneExtId(id);
if(admBean!=null && admBean.getLabels()!=null){
bean.setLabels(admBean.getLabels());
}
List<CommuneLabelBean> labelsList = communeAdmService.findAllLabels();
model.put("labelsList", labelsList);
model.put("dto", bean); model.put("dto", bean);
model.put("action", "/communeExt/update"); model.put("action", "/communeExt/update");
model.put("page", request.getParameter("page")); model.put("page", request.getParameter("page"));
...@@ -159,6 +178,11 @@ public class CommuneExtConttroller { ...@@ -159,6 +178,11 @@ public class CommuneExtConttroller {
return "market/communeExt/form"; return "market/communeExt/form";
} }
boolean success = communeExtService.update(SpringSecurityUtil.getCurrentUserName(), dto); boolean success = communeExtService.update(SpringSecurityUtil.getCurrentUserName(), dto);
CommuneAdmQuery admQuery = new CommuneAdmQuery();
admQuery.setCommuneExtId(dto.getId());
admQuery.setLabels(" "+dto.getLabels()+" ");
communeAdmService.updateLabels(admQuery);
if (!success) { if (!success) {
model.put("exceptionMsg", "修改失败!"); model.put("exceptionMsg", "修改失败!");
model.put("action", "/communeExt/update"); model.put("action", "/communeExt/update");
......
package com.ctrip.fun.admin.service.market; package com.ctrip.fun.admin.service.market;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List;
import java.util.Map; import java.util.Map;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -16,8 +17,7 @@ import com.ctrip.fun.common.vo.Request; ...@@ -16,8 +17,7 @@ import com.ctrip.fun.common.vo.Request;
import com.ctrip.fun.common.vo.Response; import com.ctrip.fun.common.vo.Response;
import com.ctrip.fun.common.vo.user.CommuneAdmBean; import com.ctrip.fun.common.vo.user.CommuneAdmBean;
import com.ctrip.fun.common.vo.user.CommuneAdmQuery; import com.ctrip.fun.common.vo.user.CommuneAdmQuery;
import com.ctrip.fun.common.vo.user.CommuneExtBean; import com.ctrip.fun.common.vo.user.CommuneLabelBean;
import com.ctrip.fun.common.vo.user.CommuneExtQuery;
public class CommuneAdmService extends BaseService{ public class CommuneAdmService extends BaseService{
...@@ -51,6 +51,50 @@ public class CommuneAdmService extends BaseService{ ...@@ -51,6 +51,50 @@ public class CommuneAdmService extends BaseService{
public PagedResponseBean<CommuneAdmBean> myBindList(CommuneAdmQuery query) {
String uri = super.getServiceUri("uri.communeAdm.myBindList");
PagedResponseBean<CommuneAdmBean> responseBean = new PagedResponseBean<CommuneAdmBean>(0,
new ArrayList<CommuneAdmBean>());
Request<CommuneAdmQuery> request = new Request<CommuneAdmQuery>("", query);
HttpEntity<Request<CommuneAdmQuery>> entity = new HttpEntity<Request<CommuneAdmQuery>>(
request);
Response<PagedResponseBean<CommuneAdmBean>> response = null;
try {
response = super.exchange(uri, HttpMethod.POST, entity,
new ParameterizedTypeReference<Response<PagedResponseBean<CommuneAdmBean>>>() {
}).getBody();
} catch (RestClientException e) {
e.printStackTrace();
}
if (response != null && response.getStatus() == 0) {
responseBean = response.getBody();
} else {
logger.error(String.format("[公社会员扩展列表获取异常] status: %d, msg: %s", response.getStatus(),
response.getMessage()));
}
return responseBean;
}
public CommuneAdmBean getById(Integer id) {
String uri = super.getServiceUri("uri.communeAdm.get");
Request<Integer> request = new Request<Integer>("", id);
CommuneAdmBean bean = null;
HttpEntity<Request<Integer>> entity = new HttpEntity<Request<Integer>>(request);
Response<CommuneAdmBean> response = super.exchange(uri, HttpMethod.POST, entity,
new ParameterizedTypeReference<Response<CommuneAdmBean>>() {
}).getBody();
if (response != null && response.getStatus() == 0) {
bean = response.getBody();
} else {
logger.error(String.format("[公社会员扩展详细信息异常] status: %d, msg: %s", response.getStatus(),
response.getMessage()));
}
return bean;
}
public Response<Integer> batchBind(Map<String, Object> query) { public Response<Integer> batchBind(Map<String, Object> query) {
String uri = super.getServiceUri("uri.communeAdm.batchBind"); String uri = super.getServiceUri("uri.communeAdm.batchBind");
...@@ -84,4 +128,58 @@ public class CommuneAdmService extends BaseService{ ...@@ -84,4 +128,58 @@ public class CommuneAdmService extends BaseService{
return response; return response;
} }
public CommuneAdmBean getByCommuneExtId(Integer id) {
String uri = super.getServiceUri("uri.communeAdm.getByCommuneExtId");
Request<Integer> request = new Request<Integer>("", id);
CommuneAdmBean bean = null;
HttpEntity<Request<Integer>> entity = new HttpEntity<Request<Integer>>(request);
Response<CommuneAdmBean> response = super.exchange(uri, HttpMethod.POST, entity,
new ParameterizedTypeReference<Response<CommuneAdmBean>>() {
}).getBody();
if (response != null && response.getStatus() == 0) {
bean = response.getBody();
} else {
logger.error(String.format("[公社会员扩展详细信息异常] status: %d, msg: %s", response.getStatus(),
response.getMessage()));
}
return bean;
}
public Response<Integer> updateLabels(CommuneAdmQuery query) {
String uri = super.getServiceUri("uri.communeAdm.updateLabels");
Request<CommuneAdmQuery> request = new Request<CommuneAdmQuery>("", query);
HttpEntity<Request<CommuneAdmQuery>> entity = new HttpEntity<Request<CommuneAdmQuery>>( request);
Response<Integer> response = null;
try {
response = super.exchange(uri, HttpMethod.POST, entity,
new ParameterizedTypeReference<Response<Integer>>() {
}).getBody();
} catch (RestClientException e) {
e.printStackTrace();
}
return response;
}
public List<CommuneLabelBean> findAllLabels() {
String uri = super.getServiceUri("uri.communeAdm.findAllLabels");
Request<Integer> request = new Request<Integer>("", 1);
HttpEntity<Request<Integer>> entity = new HttpEntity<Request<Integer>>(request);
Response<List<CommuneLabelBean>> response = super.exchange(uri, HttpMethod.POST, entity,
new ParameterizedTypeReference<Response<List<CommuneLabelBean>>>() {
}).getBody();
/* if (response != null && response.getStatus() == 0) {
bean = response.getBody();
} else {
logger.error(String.format("[公社会员扩展详细信息异常] status: %d, msg: %s", response.getStatus(),
response.getMessage()));
}*/
return response.getBody();
}
} }
...@@ -117,6 +117,22 @@ public class CommuneExtService extends BaseService { ...@@ -117,6 +117,22 @@ public class CommuneExtService extends BaseService {
return bean; return bean;
} }
public Integer insert(String userId, CommuneExtBean bean) {
String uri = super.getServiceUri("uri.communeExt.add");
Request<CommuneExtBean> request = new Request<CommuneExtBean>(userId, bean);
HttpEntity<Request<CommuneExtBean>> entity = new HttpEntity<Request<CommuneExtBean>>(
request);
Response<Object> response = super.exchange(uri, HttpMethod.POST, entity,
new ParameterizedTypeReference<Response<Object>>() {
}).getBody();
if (response != null && response.getStatus() == 0) {
return (Integer) response.getBody();
}else{
return null;
}
}
public boolean add(String userId, CommuneExtBean bean) { public boolean add(String userId, CommuneExtBean bean) {
boolean success = false; boolean success = false;
String uri = super.getServiceUri("uri.communeExt.add"); String uri = super.getServiceUri("uri.communeExt.add");
......
...@@ -458,6 +458,10 @@ uri.communeExt.importCommuneExts=/fun-golf-service/communeExt/importCommuneExts ...@@ -458,6 +458,10 @@ uri.communeExt.importCommuneExts=/fun-golf-service/communeExt/importCommuneExts
uri.communeAdm.list=/fun-golf-service/communeAdm/list uri.communeAdm.list=/fun-golf-service/communeAdm/list
uri.communeAdm.batchBind=/fun-golf-service/communeAdm/batchBind uri.communeAdm.batchBind=/fun-golf-service/communeAdm/batchBind
uri.communeAdm.batchUnbind=/fun-golf-service/communeAdm/batchUnbind uri.communeAdm.batchUnbind=/fun-golf-service/communeAdm/batchUnbind
uri.communeAdm.myBindList=/fun-golf-service/communeAdm/myBindList
uri.communeAdm.getByCommuneExtId=/fun-golf-service/communeAdm/getByCommuneExtId
uri.communeAdm.findAllLabels=/fun-golf-service/communeAdm/findAllLabels
uri.communeAdm.updateLabels=/fun-golf-service/communeAdm/updateLabels
# workPoint # workPoint
uri.workPoint.queryWorkPointLogsList=/fun-golf-service/userWorkPointLog/query uri.workPoint.queryWorkPointLogsList=/fun-golf-service/userWorkPointLog/query
......
...@@ -484,13 +484,10 @@ ${pageCss} ...@@ -484,13 +484,10 @@ ${pageCss}
<ul class="nav nav-list"> <ul class="nav nav-list">
<li class="nav-header"社员管理</li> <li class="nav-header"社员管理</li>
<li <#if current == "communeAdm_list">class="active"</#if>> <li <#if current == "communeAdm_list">class="active"</#if>>
<a href="/communeAdm/queryList">列表</a> <a href="/communeAdm/queryList">绑定管理员</a>
</li> </li>
<li <#if current == "communeExt_create">class="active"</#if>> <li <#if current == "communeAdm_myBindList">class="active"</#if>>
<a href="/communeExt/create">新建</a> <a href="/communeAdm/myBindList">我管理的社员</a>
</li>
<li <#if current == "communeExt_import">class="active"</#if>>
<a href="/communeExt/import">导入</a>
</li> </li>
</ul> </ul>
</#if> </#if>
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<li <#if module?? && module == "statistics">class="active"</#if>><a href="/statistics/totalOrder/listTotalStatistics">数据统计</a></li> <li <#if module?? && module == "statistics">class="active"</#if>><a href="/statistics/totalOrder/listTotalStatistics">数据统计</a></li>
<li <#if module?? && module == "tools">class="active"</#if>><a href="/tools/map">工具</a></li> <li <#if module?? && module == "tools">class="active"</#if>><a href="/tools/map">工具</a></li>
<li <#if module?? && module == "finance_management">class="active"</#if>><a href="/courseFinance/queryCourseOrder">财务</a></li> <li <#if module?? && module == "finance_management">class="active"</#if>><a href="/courseFinance/queryCourseOrder">财务</a></li>
<li <#if module?? && module == "communeAdm">class="active"</#if>><a href="/communeAdm/queryList">会服</a></li> <li <#if module?? && module == "communeAdm">class="active"</#if>><a href="/communeAdm/myBindList">会服</a></li>
</ul> </ul>
<ul class="nav pull-right"> <ul class="nav pull-right">
......
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
$("#adminName").html(html); $("#adminName").html(html);
}) })
}) });
//全选或者全不选 //全选或者全不选
...@@ -78,33 +78,6 @@ ...@@ -78,33 +78,6 @@
$('#statusbtn').click(function () {
var chgids = "";
var checkboxes = $('[name="datacheck"]:checked');
checkboxes.each(function () {
chgids = chgids + $(this).attr("id") + ",";
});
chgids = chgids.substr(0, chgids.length - 1);
$("#rids").val(chgids);
$(this).button('loading');
$.ajax({
url: '/j/resource/status/batchedit',
data: $('#statusForm').serialize(),
type: 'POST',
success: function (msg) {
if (msg['status'] == 0) {
location.reload();
}
else {
alert(msg['message']);
$('#statusbtn').button("hide");
}
}
});
});
</script> </script>
</#assign> </#assign>
<#assign pageCssContent> <#assign pageCssContent>
...@@ -121,6 +94,7 @@ ...@@ -121,6 +94,7 @@
<@com.textInput "dto.mobilePhone" "style=\"margin-left: 5px;\"" "电话"/> <@com.textInput "dto.mobilePhone" "style=\"margin-left: 5px;\"" "电话"/>
<@com.textInput "dto.uid" "style=\"margin-left: 5px;\"" "UID"/> <@com.textInput "dto.uid" "style=\"margin-left: 5px;\"" "UID"/>
<br /> <br />
<@com.textInput "dto.drawer" "style=\"margin-left: 5px;\"" "开单人"/>
<@com.textInput "dto.bindedAdm" "style=\"margin-left: 5px;\"" "绑定会服" /> <@com.textInput "dto.bindedAdm" "style=\"margin-left: 5px;\"" "绑定会服" />
<@com.textInputTwoDate "dto.communeAgainTimeStart" "dto.communeAgainTimeEnd" "" "社员到期时间"/> <@com.textInputTwoDate "dto.communeAgainTimeStart" "dto.communeAgainTimeEnd" "" "社员到期时间"/>
...@@ -139,6 +113,7 @@ ...@@ -139,6 +113,7 @@
<th>姓名</th> <th>姓名</th>
<th>电话</th> <th>电话</th>
<th>uid</th> <th>uid</th>
<th>开单人</th>
<th>生日</th> <th>生日</th>
<th>社员到期时间</th> <th>社员到期时间</th>
<th>绑定会服</th> <th>绑定会服</th>
...@@ -152,8 +127,11 @@ ...@@ -152,8 +127,11 @@
<tr> <tr>
<td><input type="checkbox" name="datacheck" data-index="${item_index}" id="${item.id}" class="J_shiftCheck J_check-${item_index}" value="${item.id}"></td> <td><input type="checkbox" name="datacheck" data-index="${item_index}" id="${item.id}" class="J_shiftCheck J_check-${item_index}" value="${item.id}"></td>
<td>${item.userName!}</td> <td>${item.userName!}</td>
<td>${item.mobilePhone!}</td> <td>
<a href="/system/user/${item.mobilePhone!}/detailByUid">${item.mobilePhone!}</a>
</td>
<td>${item.uid!}</td> <td>${item.uid!}</td>
<td>${item.drawer!}</td>
<td><#if item.birthday??>${item.birthday?string("yyyy-MM-dd")}</#if></td> <td><#if item.birthday??>${item.birthday?string("yyyy-MM-dd")}</#if></td>
<td><#if item.communeAgainTime??>${item.communeAgainTime?string("yyyy-MM-dd HH:mm:ss")}</#if></td> <td><#if item.communeAgainTime??>${item.communeAgainTime?string("yyyy-MM-dd HH:mm:ss")}</#if></td>
<td>${item.bindedAdm!}</td> <td>${item.bindedAdm!}</td>
...@@ -161,7 +139,7 @@ ...@@ -161,7 +139,7 @@
<td> <td>
<a href="/communeAdm/update?id=${item.id!}&page=${paginationData.pageNumber}">修改</a> <!-- <a href="/communeAdm/update?id=${item.id!}&page=${paginationData.pageNumber}">修改</a> -->
</td> </td>
</tr> </tr>
</#list> </#list>
......
<#assign pageJsContent>
<script>
$(function(){
$('#labelSelectedBtn').on("click",function(){
var selectedJsonArray = [];
var chooseChecked = $(".choose.checked");
var html = '';
var labels = '';
for(var i=0;i< chooseChecked.length;i++){
html+='<span class="tag label label-info" data-id="'+chooseChecked[i].getAttribute("data-id")+'"> '+chooseChecked[i].innerHTML+'<span data-role="remove"></span></span>';
labels+=chooseChecked[i].getAttribute("data-id")+' ';
}
//将selectedJsonArray 信息保存到 搜索栏文本框
$(".bootstrap-tagsinput").html(html);
labels = labels.trim();
$("#labels").val(labels);
$('#tagSelectModal').modal('hide');
});
});
//全选或者全不选
function shiftCheckAll(){
if($('#checkAll').is(':checked')) {
$(".J_shift :checkbox").prop("checked", true);
}else{
$(".J_shift :checkbox").prop("checked", false);
}
}
function openTagModel(){
$('#tagSelectModal').modal('show');
}
$('#tagSelectModal').on('show.bs.modal', function (e) {
//查询所有的标签
$.get("/communeAdm/labels/list",{},function(data){
//返回找出所有的会服
var html='';
for(var i=0;i<data.length;i++){
var classhtml = 'choose';
var labels = $("#labels").val();
if(labels!='undefinded' && labels!=null){
var labelArray = labels.split(' ');
for(var j =0;j< labelArray.length;j++){
if(data[i].id == labelArray[j]){
classhtml = 'choose checked';
break;
}
}
}
html+='<span class="'+classhtml+'" data-id="'+data[i].id+'" >'+data[i].labelName+'</span>';
}
$(".contentTxt").html(html);
$(".choose").on("click",function(e){
var $cur = $(e.currentTarget)
if($cur.hasClass("checked")){
$cur.removeClass("checked");
}else{
$cur.addClass("checked");
}
});
});
});
</script>
</#assign>
<#assign pageCssContent>
<style>
.table th, .table td{ text-align:center;vertical-align:middle;}
.widthShow {
width: 1100px;
}
.choose{ float: left; padding: 4px;border:1px solid #1abc9c; color: #000000; margin-right:4px;border-radius:3px; -webkit-border-radius:3px}
.checked { background: #1abc9c; color: white; }
.bootstrap-tagsinput {
background-color: white;
border: 2px solid #ebedef;
border-radius: 6px;
margin-bottom: 18px;
padding: 6px 1px 1px 6px;
text-align: left;
font-size: 0;
min-height:25px;
}
.bootstrap-tagsinput .tag {
border-radius: 4px;
background-color: #ebedef;
color: #7b8996;
font-size: 13px;
cursor: pointer;
display: inline-block;
position: relative;
vertical-align: middle;
overflow: hidden;
margin: 0 7px 7px 0;
line-height: 15px;
padding: 6px 21px;
transition: .25s linear;
}
.bootstrap-tagsinput .tag > span {
color: white;
cursor: pointer;
font-size: 12px;
position: absolute;
right: 0;
text-align: right;
text-decoration: none;
top: 0;
width: 100%;
bottom: 0;
padding: 0 10px 0 0;
z-index: 2;
opacity: 0;
-webkit-transition: opacity .25s linear;
transition: opacity .25s linear;
}
/**
.bootstrap-tagsinput .tag > span:after {
content: "X";
font-family: "Flat-UI-Icons";
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
line-height: 27px;
}
.bootstrap-tagsinput .tag:hover {
background-color: #16a085;
color: white;
padding-right: 28px;
padding-left: 14px;
}
**/
.bootstrap-tagsinput .tag:hover > span {
opacity: 1;
filter: none;
}
.bootstrap-tagsinput input[type="text"] {
font-size: 14px;
border: none;
box-shadow: none;
outline: none;
background-color: transparent;
padding: 0;
margin: 0;
width: auto !important;
max-width: inherit;
min-width: 80px;
vertical-align: top;
height: 29px;
color: #34495e;
}
.bootstrap-tagsinput input[type="text"]:first-child {
height: 23px;
margin: 3px 0 8px;
}
.tags_clear {
clear: both;
width: 100%;
height: 0;
}
.not_valid {
background: #fbd8db !important;
color: #90111a !important;
margin-left: 5px !important;
}
.tagsinput-primary .bootstrap-tagsinput {
border-color: #1abc9c;
margin-bottom: 0;
}
.tagsinput-primary .tag {
background-color: #1abc9c;
color: white;
}
.tagsinput-primary .tag:hover {
background-color: #16a085;
color: white;
}
.bootstrap-tagsinput .twitter-typeahead {
width: auto;
vertical-align: top;
}
.bootstrap-tagsinput .twitter-typeahead .tt-input {
min-width: 200px;
}
.bootstrap-tagsinput .twitter-typeahead .tt-dropdown-menu {
width: auto;
min-width: 120px;
margin-top: 11px;
}
.clear::after{display:block; content:"";overflow:hidden; clear:both;}
</style>
</#assign>
<@com.layout title="查询公社会员" module="communeAdm" current="communeAdm_myBindList" pageCss=pageCssContent pageJs=pageJsContent>
<form id="formId" class="form-inline search-box widthShow" action="/communeAdm/myBindList" method="get" autocomplete="off" >
<@com.textInput "dto.userName" "style=\"margin-left: 5px;\"" "姓名"/>
<@com.textInput "dto.mobilePhone" "style=\"margin-left: 5px;\"" "电话"/>
<@com.textInput "dto.uid" "style=\"margin-left: 5px;\"" "UID"/>
<br />
<div class="long_content_div clear" style="width:900px;">
<label class="control-label" for="labels" style="float:left;">标签</label>
<div class="tagsinput-primary input-medium" style="float:left; width:700px;" onclick="openTagModel();">
<input id="labels" name="labels" class="tagsinput" type="hidden" value="${dto.labels!}" style="display: none;">
<div class="bootstrap-tagsinput">
<#if dto.labels??>
<#list dto.labels?split(" ") as label>
<#list labelsList as tag>
<#if tag.id?c == label>
<span class="tag label label-info" data-id="${label}"> ${tag.labelName}<span data-role="remove"></span></span>
<#break>
</#if>
</#list>
</#list>
</#if>
</div>
</div>
</div>
<@com.textInputTwoDate "dto.communeAgainTimeStart" "dto.communeAgainTimeEnd" "" "社员到期时间"/>
<br />
<button type="submit" id="selectButton" class="btn btn-primary">查询</button>
</form>
<table class="table table-bordered table-striped widthShow">
<thead>
<tr>
<th><input type="checkbox" name="checkAll" id="checkAll" onclick="shiftCheckAll();"> </th>
<th>姓名</th>
<th>电话</th>
<th>uid</th>
<th>生日</th>
<th>社员到期时间</th>
<th>标签</th>
<th>绑定会服</th>
<th>绑定时间</th>
<th colspan=1>操作</th>
</tr>
</thead>
<tbody class="J_shift">
<#list list as item>
<tr>
<td><input type="checkbox" name="datacheck" data-index="${item_index}" id="${item.id}" class="J_shiftCheck J_check-${item_index}" value="${item.id}"></td>
<td>${item.userName!}</td>
<td>
<a href="/system/user/${item.mobilePhone!}/detailByUid">${item.mobilePhone!}</a>
</td>
<td>${item.uid!}</td>
<td><#if item.birthday??>${item.birthday?string("yyyy-MM-dd")}</#if></td>
<td><#if item.communeAgainTime??>${item.communeAgainTime?string("yyyy-MM-dd HH:mm:ss")}</#if></td>
<td>${item.labels!}</td>
<td>${item.bindedAdm!}</td>
<td><#if item.bindTime??>${item.bindTime?string("yyyy-MM-dd HH:mm:ss")}</#if></td>
<td>
<a target="_blank" href="/communeExt/update?id=${item.id!}&page=1">社员资料</a>
</td>
</tr>
</#list>
</tbody>
</table>
<div class="pagination pagination-right widthShow">
<ul>
<@paginator.first />
<@paginator.previous />
<@paginator.numbers separator=""/>
<@paginator.next />
<@paginator.last />
</ul>
<@paginator.statistics />
</div>
<div class="modal hide fade" id="tagSelectModal" style="display:none;">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h3>选择标签</h3>
</div>
<div class="modal-body">
<form class="form-inline form-horizontal" method="post" id="statusForm">
<div class="contentTxt"></div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary pull-right bottom_margin" data-loading-text="执行中..."
id="labelSelectedBtn">选择
</button>
</div>
</div>
</@com.layout>
\ No newline at end of file
...@@ -9,6 +9,26 @@ ...@@ -9,6 +9,26 @@
<script type="text/javascript" src="${staticServer}/js/lib/highlight.js"></script> <script type="text/javascript" src="${staticServer}/js/lib/highlight.js"></script>
<script> <script>
$(function(){
$('#labelSelectedBtn').on("click",function(){
var selectedJsonArray = [];
var chooseChecked = $(".choose.checked");
var html = '';
var labels = '';
for(var i=0;i< chooseChecked.length;i++){
html+='<span class="tag label label-info" data-id="'+chooseChecked[i].getAttribute("data-id")+'"> '+chooseChecked[i].innerHTML+'<span data-role="remove"></span></span>';
labels+=chooseChecked[i].getAttribute("data-id")+' ';
}
//将selectedJsonArray 信息保存到 搜索栏文本框
$(".bootstrap-tagsinput").html(html);
labels = labels.trim();
$("#labels").val(labels);
$('#tagSelectModal').modal('hide');
});
});
function submitFun(){ function submitFun(){
handlerData(); handlerData();
$("#submitButton").click(); $("#submitButton").click();
...@@ -48,10 +68,53 @@ ...@@ -48,10 +68,53 @@
_jQueryObj.focus(); _jQueryObj.focus();
} }
} }
function openTagModel(){
$('#tagSelectModal').modal('show');
}
$('#tagSelectModal').on('show.bs.modal', function (e) {
//查询所有的标签
$.get("/communeAdm/labels/list",{},function(data){
//返回找出所有的会服
var html='';
for(var i=0;i<data.length;i++){
var classhtml = 'choose';
var labels = $("#labels").val();
if(labels!='undefinded' && labels!=null){
var labelArray = labels.split(' ');
for(var j =0;j< labelArray.length;j++){
if(data[i].id == labelArray[j]){
classhtml = 'choose checked';
break;
}
}
}
html+='<span class="'+classhtml+'" data-id="'+data[i].id+'" >'+data[i].labelName+'</span>';
}
$(".contentTxt").html(html);
$(".choose").on("click",function(e){
var $cur = $(e.currentTarget)
if($cur.hasClass("checked")){
$cur.removeClass("checked");
}else{
$cur.addClass("checked");
}
});
});
});
</script> </script>
</#assign> </#assign>
<#assign pageCssContent> <#assign pageCssContent>
<style> <style>
.choose{ float: left; padding: 4px;border:1px solid #1abc9c; color: #000000; margin-right:4px;border-radius:3px; -webkit-border-radius:3px}
.checked { background: #1abc9c; color: white; }
#imagePathShow .currentImage img{ #imagePathShow .currentImage img{
max-height: 300px; max-height: 300px;
} }
...@@ -66,6 +129,123 @@ ...@@ -66,6 +129,123 @@
font-size: 40px; font-size: 40px;
color: #dddddd; color: #dddddd;
} }
.bootstrap-tagsinput {
background-color: white;
border: 2px solid #ebedef;
border-radius: 6px;
margin-bottom: 18px;
padding: 6px 1px 1px 6px;
text-align: left;
font-size: 0;
min-height:25px;
}
.bootstrap-tagsinput .tag {
border-radius: 4px;
background-color: #ebedef;
color: #7b8996;
font-size: 13px;
cursor: pointer;
display: inline-block;
position: relative;
vertical-align: middle;
overflow: hidden;
margin: 0 7px 7px 0;
line-height: 15px;
padding: 6px 21px;
transition: .25s linear;
}
.bootstrap-tagsinput .tag > span {
color: white;
cursor: pointer;
font-size: 12px;
position: absolute;
right: 0;
text-align: right;
text-decoration: none;
top: 0;
width: 100%;
bottom: 0;
padding: 0 10px 0 0;
z-index: 2;
opacity: 0;
-webkit-transition: opacity .25s linear;
transition: opacity .25s linear;
}
/**
.bootstrap-tagsinput .tag > span:after {
content: "X";
font-family: "Flat-UI-Icons";
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
line-height: 27px;
}
.bootstrap-tagsinput .tag:hover {
background-color: #16a085;
color: white;
padding-right: 28px;
padding-left: 14px;
}
**/
.bootstrap-tagsinput .tag:hover > span {
opacity: 1;
filter: none;
}
.bootstrap-tagsinput input[type="text"] {
font-size: 14px;
border: none;
box-shadow: none;
outline: none;
background-color: transparent;
padding: 0;
margin: 0;
width: auto !important;
max-width: inherit;
min-width: 80px;
vertical-align: top;
height: 29px;
color: #34495e;
}
.bootstrap-tagsinput input[type="text"]:first-child {
height: 23px;
margin: 3px 0 8px;
}
.tags_clear {
clear: both;
width: 100%;
height: 0;
}
.not_valid {
background: #fbd8db !important;
color: #90111a !important;
margin-left: 5px !important;
}
.tagsinput-primary .bootstrap-tagsinput {
border-color: #1abc9c;
margin-bottom: 0;
}
.tagsinput-primary .tag {
background-color: #1abc9c;
color: white;
}
.tagsinput-primary .tag:hover {
background-color: #16a085;
color: white;
}
.bootstrap-tagsinput .twitter-typeahead {
width: auto;
vertical-align: top;
}
.bootstrap-tagsinput .twitter-typeahead .tt-input {
min-width: 200px;
}
.bootstrap-tagsinput .twitter-typeahead .tt-dropdown-menu {
width: auto;
min-width: 120px;
margin-top: 11px;
}
.clear::after{display:block; content:"";overflow:hidden; clear:both;}
</style> </style>
</#assign> </#assign>
<@com.layout title="公社会员详细" module="communeOrder" current="communeExt_create" pageJs=pageJsContent pageCss=pageCssContent> <@com.layout title="公社会员详细" module="communeOrder" current="communeExt_create" pageJs=pageJsContent pageCss=pageCssContent>
...@@ -110,6 +290,26 @@ ...@@ -110,6 +290,26 @@
<@form.textArea path="dto.remark" attributes="class=\"input-medium\" rows=\"5\"" label="备注" required = false /> <@form.textArea path="dto.remark" attributes="class=\"input-medium\" rows=\"5\"" label="备注" required = false />
<div class="long_content_div clear" style="width:900px;">
<label class="control-label" for="labels" style="float:left;">标签</label>
<div class="tagsinput-primary input-medium" style="float:left; width:700px;" onclick="openTagModel();">
<input id="labels" name="labels" class="tagsinput" type="hidden" value="${dto.labels!}" style="display: none;">
<div class="bootstrap-tagsinput">
<#if dto.labels??>
<#list dto.labels?split(" ") as label>
<#list labelsList as tag>
<#if tag.id?c == label>
<span class="tag label label-info" data-id="${label}"> ${tag.labelName}<span data-role="remove"></span></span>
<#break>
</#if>
</#list>
</#list>
</#if>
</div>
</div>
</div>
<div class="long_content_div control-group "> <div class="long_content_div control-group ">
<input type="hidden" id="domain" value="${imageServer}"> <input type="hidden" id="domain" value="${imageServer}">
<input type="hidden" id="imageServer" value="${imageServer}"> <input type="hidden" id="imageServer" value="${imageServer}">
...@@ -156,4 +356,24 @@ ...@@ -156,4 +356,24 @@
</div> </div>
</div> </div>
</form> </form>
<div class="modal hide fade" id="tagSelectModal" style="display:none;">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h3>选择标签</h3>
</div>
<div class="modal-body">
<form class="form-inline form-horizontal" method="post" id="statusForm">
<div class="contentTxt"></div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary pull-right bottom_margin" data-loading-text="执行中..."
id="labelSelectedBtn">选择
</button>
</div>
</div>
</@com.layout> </@com.layout>
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 sign in to comment