Commit d2d8c366 by Huang Linyu

Merge branch 'f-6.6.7' into release

parents cb227d70 0ebac747
package com.ctrip.fun.admin.controller.market;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ModelAttribute;
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.ResponseBody;
import org.springframework.web.bind.annotation.ResponseStatus;
import com.ctrip.fun.admin.form.PaginationForm;
import com.ctrip.fun.admin.service.market.CommuneAdmService;
import com.ctrip.fun.admin.service.market.CommuneExtService;
import com.ctrip.fun.admin.service.system.UserDetailsService;
import com.ctrip.fun.admin.utility.SpringSecurityUtil;
import com.ctrip.fun.common.vo.PagedResponseBean;
import com.ctrip.fun.common.vo.Response;
import com.ctrip.fun.common.vo.ResponseStatusEnum;
import com.ctrip.fun.common.vo.adminUser.AdminUserBean;
import com.ctrip.fun.common.vo.product.CourseResourcePaymentBean;
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.CommuneLabelBean;
@Controller
@RequestMapping("/communeAdm")
public class CommuneAdmController {
@Autowired
private CommuneAdmService communeAdmService;
@Autowired
private CommuneExtService communeExtService;
@Autowired
private UserDetailsService userDetailsService;
@RequestMapping(value = "queryList", method = RequestMethod.GET)
public String queryList(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"));
}
query.setPagerOffset(currentPage * query.getPagerPerPage());
PagedResponseBean<CommuneAdmBean> response = communeAdmService.list(query);
pageSize = query.getPagerPerPage();
total = response.getCount();
pageCount = (0 == total % pageSize) ? (total / pageSize) : (total / pageSize + 1);
model.put("list", response.getResult());
model.put("paginationData", new PaginationForm(currentPage, pageSize, pageCount, total));
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";
}*/
/**
* 批量绑定管理员
*/
@RequestMapping(value = "/batchBind", method = RequestMethod.POST)
@ResponseStatus(HttpStatus.OK)
@ResponseBody
public Response<Integer> batchBind(HttpServletRequest request, @RequestParam(value = "admUserId", required = true) Integer admUserId,
@RequestParam(value = "communeExtIds", required = true) String communeExtIds) {
Map<String,Object> map = new HashMap<String,Object>();
map.put("admUserId", admUserId);
map.put("communeExtIds", communeExtIds.split(","));
Response<Integer> response = communeAdmService.batchBind(map);
return response;
}
/**
* 批量解绑管理员
*/
@RequestMapping(value = "/batchUnbind", method = RequestMethod.POST)
@ResponseStatus(HttpStatus.OK)
@ResponseBody
public Response<Integer> batchUnBind(HttpServletRequest request,
@RequestParam(value = "communeExtIds", required = true) String communeExtIds) {
Map<String,Object> map = new HashMap<String,Object>();
// map.put("admUserId", admUserId);
map.put("communeExtIds", communeExtIds.split(","));
Response<Integer> response = communeAdmService.batchUnbind(map);
return response;
}
@ResponseBody
@RequestMapping(value = "/labels/list", method = RequestMethod.GET)
public List<CommuneLabelBean> findAllLabels() {
List<CommuneLabelBean> labelsList = communeAdmService.findAllLabels();
return labelsList;
}
/**
* 获得会服人员列表
* @param request
* @return
*/
@ResponseBody
@RequestMapping(value = "/list/communeAdmUser", method = RequestMethod.GET)
public List<Map<String,Object>> getCommuneAdmUserList(HttpServletRequest request) {
List<Map<String,Object>> list = new ArrayList<Map<String,Object>>();
Response<List<AdminUserBean>> response = userDetailsService.getCommuneAdmUserList(null);
List<AdminUserBean> admUserList = response.getBody();
for (AdminUserBean bean: admUserList){
Map<String,Object> map = new HashMap<String,Object>();
map.put("admUserId", bean.getId());
map.put("admUsername", bean.getUserName());
list.add(map);
}
return list;
}
}
...@@ -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;
...@@ -55,7 +61,9 @@ public class CommuneExtConttroller { ...@@ -55,7 +61,9 @@ public class CommuneExtConttroller {
private CommuneExtService communeExtService; private CommuneExtService communeExtService;
@Autowired @Autowired
private UserService userExtService ; private UserService userExtService ;
@Autowired
private CommuneAdmService communeAdmService;
@Autowired @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");
......
...@@ -7,7 +7,9 @@ package com.ctrip.fun.admin.controller.system; ...@@ -7,7 +7,9 @@ package com.ctrip.fun.admin.controller.system;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
import java.util.Collection; import java.util.Collection;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
...@@ -16,8 +18,10 @@ import org.springframework.stereotype.Controller; ...@@ -16,8 +18,10 @@ import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap; import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
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.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.mvc.support.RedirectAttributes; import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import com.ctrip.fun.admin.form.PaginationForm; import com.ctrip.fun.admin.form.PaginationForm;
...@@ -27,7 +31,9 @@ import com.ctrip.fun.admin.template.FlashMessageDirective; ...@@ -27,7 +31,9 @@ import com.ctrip.fun.admin.template.FlashMessageDirective;
import com.ctrip.fun.common.core.util.BeanConverter; import com.ctrip.fun.common.core.util.BeanConverter;
import com.ctrip.fun.common.core.util.DateUtil; import com.ctrip.fun.common.core.util.DateUtil;
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.SortDirectionEnum; import com.ctrip.fun.common.vo.SortDirectionEnum;
import com.ctrip.fun.common.vo.adminUser.AdminUserBean;
import com.ctrip.fun.common.vo.basic.GenderEnum; import com.ctrip.fun.common.vo.basic.GenderEnum;
import com.ctrip.fun.common.vo.basic.UserExtQuery; import com.ctrip.fun.common.vo.basic.UserExtQuery;
import com.ctrip.fun.common.vo.basic.VoucherItemDTO; import com.ctrip.fun.common.vo.basic.VoucherItemDTO;
...@@ -170,6 +176,8 @@ public class UserController { ...@@ -170,6 +176,8 @@ public class UserController {
return "system/UserInfoDetail"; return "system/UserInfoDetail";
} }
/** /**
* 获取兑换礼品列表 * 获取兑换礼品列表
* *
......
package com.ctrip.fun.admin.controller.system; package com.ctrip.fun.admin.controller.system;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
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.ui.ModelMap; import org.springframework.ui.ModelMap;
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.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.ctrip.fun.admin.service.system.UserDetailsService; import com.ctrip.fun.admin.service.system.UserDetailsService;
import com.ctrip.fun.common.core.util.EncryptUtil; import com.ctrip.fun.common.core.util.EncryptUtil;
import com.ctrip.fun.common.vo.Response;
import com.ctrip.fun.common.vo.adminUser.AdminUserBean; import com.ctrip.fun.common.vo.adminUser.AdminUserBean;
@Controller @Controller
...@@ -72,4 +81,5 @@ public class adminUserController { ...@@ -72,4 +81,5 @@ public class adminUserController {
return "user/admin/adminLogin"; return "user/admin/adminLogin";
} }
} }
...@@ -76,6 +76,19 @@ public class SendMessageController { ...@@ -76,6 +76,19 @@ public class SendMessageController {
model.put("action", "/sendMessage/create"); model.put("action", "/sendMessage/create");
return "tools/sendMessage/form"; return "tools/sendMessage/form";
} }
/**
* 发送短信页
*
* @param dto
* @param model
* @return
*/
@RequestMapping(value = "/call", method = RequestMethod.GET)
public String toCall(@ModelAttribute("dto") SmsForm dto, ModelMap model) {
model.put("action", "/sendMessage/call");
return "tools/sendMessage/call";
}
/** /**
* 发送短信 * 发送短信
......
package com.ctrip.fun.admin.service.market;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpMethod;
import org.springframework.web.client.RestClientException;
import com.ctrip.fun.admin.service.BaseService;
import com.ctrip.fun.common.vo.PagedResponseBean;
import com.ctrip.fun.common.vo.Request;
import com.ctrip.fun.common.vo.Response;
import com.ctrip.fun.common.vo.user.CommuneAdmBean;
import com.ctrip.fun.common.vo.user.CommuneAdmQuery;
import com.ctrip.fun.common.vo.user.CommuneLabelBean;
public class CommuneAdmService extends BaseService{
private static Logger logger = LoggerFactory.getLogger(CommuneExtService.class);
public PagedResponseBean<CommuneAdmBean> list(CommuneAdmQuery query) {
String uri = super.getServiceUri("uri.communeAdm.list");
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 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) {
String uri = super.getServiceUri("uri.communeAdm.batchBind");
Request<Map<String, Object>> request = new Request<Map<String, Object>>("", query);
HttpEntity<Request<Map<String, Object>>> entity = new HttpEntity<Request<Map<String, Object>>>(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 Response<Integer> batchUnbind(Map<String, Object> query) {
String uri = super.getServiceUri("uri.communeAdm.batchUnbind");
Request<Map<String, Object>> request = new Request<Map<String, Object>>("", query);
HttpEntity<Request<Map<String, Object>>> entity = new HttpEntity<Request<Map<String, Object>>>( 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 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");
......
...@@ -156,7 +156,17 @@ public final class UserDetailsService extends BaseService implements org.springf ...@@ -156,7 +156,17 @@ public final class UserDetailsService extends BaseService implements org.springf
} }
return retBean; return retBean;
} }
public Response<List<AdminUserBean>> getCommuneAdmUserList(Integer query) {
Request<Integer> request = new Request<Integer>("", query);
HttpEntity<Request<Integer>> entity = new HttpEntity<Request<Integer>>(request);
Response<List<AdminUserBean>> response = super.exchange(
this.getServiceUri("uri.adminUser.communeAdmUserList"), HttpMethod.POST, entity,
new ParameterizedTypeReference<Response<List<AdminUserBean>>>() {
}).getBody();
return response;
}
public SipPhoneService getSipPhoneService() { public SipPhoneService getSipPhoneService() {
return sipPhoneService; return sipPhoneService;
} }
......
...@@ -6,6 +6,7 @@ package com.ctrip.fun.admin.service.system; ...@@ -6,6 +6,7 @@ package com.ctrip.fun.admin.service.system;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -20,6 +21,7 @@ import com.ctrip.fun.common.vo.Request; ...@@ -20,6 +21,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.ResponseStatusEnum; import com.ctrip.fun.common.vo.ResponseStatusEnum;
import com.ctrip.fun.common.vo.SortDirectionEnum; import com.ctrip.fun.common.vo.SortDirectionEnum;
import com.ctrip.fun.common.vo.adminUser.AdminUserBean;
import com.ctrip.fun.common.vo.basic.UserExtQuery; import com.ctrip.fun.common.vo.basic.UserExtQuery;
import com.ctrip.fun.common.vo.basic.UserPrepayCardInfoBean; import com.ctrip.fun.common.vo.basic.UserPrepayCardInfoBean;
import com.ctrip.fun.common.vo.basic.UserPrepayCardLogQuery; import com.ctrip.fun.common.vo.basic.UserPrepayCardLogQuery;
......
...@@ -70,6 +70,8 @@ ...@@ -70,6 +70,8 @@
<sec:intercept-url pattern="/file/**" access="ROLE_OP,ROLE_DEV,ROLE_PROD,ROLE_RISK,ROLE_ASSIST,ROLE_COMMUNE" /> <sec:intercept-url pattern="/file/**" access="ROLE_OP,ROLE_DEV,ROLE_PROD,ROLE_RISK,ROLE_ASSIST,ROLE_COMMUNE" />
<sec:intercept-url pattern="/ingegral/**" access="ROLE_DEV,ROLE_USERINFO_MODIFY" /> <sec:intercept-url pattern="/ingegral/**" access="ROLE_DEV,ROLE_USERINFO_MODIFY" />
<sec:intercept-url pattern="/callcenter/sipPhone/**" access="ROLE_TEL,ROLE_ASSIST,ROLE_PROMOTION" /> <sec:intercept-url pattern="/callcenter/sipPhone/**" access="ROLE_TEL,ROLE_ASSIST,ROLE_PROMOTION" />
<sec:intercept-url pattern="/communeAdm/queryList" access="ROLE_COMMUNE_SYS_ADMIN" />
<sec:intercept-url pattern="/communeAdm/**" access="ROLE_COMMUNE_SYS_ADMIN,ROLE_COMMUNE_SYS" />
<sec:intercept-url pattern="/**" access="ROLE_DEV" /> <sec:intercept-url pattern="/**" access="ROLE_DEV" />
<sec:form-login login-page="/adminUser/adminLoginGet" authentication-failure-url="/adminUser/adminLoginError" default-target-url="/marketing/campaign/create" /> <sec:form-login login-page="/adminUser/adminLoginGet" authentication-failure-url="/adminUser/adminLoginError" default-target-url="/marketing/campaign/create" />
......
...@@ -276,6 +276,9 @@ ...@@ -276,6 +276,9 @@
<bean name="communeExtExcelService" <bean name="communeExtExcelService"
class="com.ctrip.fun.admin.service.market.CommuneExtExcelService" class="com.ctrip.fun.admin.service.market.CommuneExtExcelService"
parent="abstractExcelExportService1" /> parent="abstractExcelExportService1" />
<!-- 社员绑定信息 -->
<bean name="communeAdmService" class="com.ctrip.fun.admin.service.market.CommuneAdmService"
parent="baseService" />
<!-- 签到 --> <!-- 签到 -->
<bean name="signService" class="com.ctrip.fun.admin.service.basic.SignService" <bean name="signService" class="com.ctrip.fun.admin.service.basic.SignService"
parent="baseService" /> parent="baseService" />
......
...@@ -24,6 +24,7 @@ uri.voucher.exportVoucherExcel=/fun-golf-service/Voucher/exportVoucherExcel ...@@ -24,6 +24,7 @@ uri.voucher.exportVoucherExcel=/fun-golf-service/Voucher/exportVoucherExcel
#admin user #admin user
uri.adminUser.userDetail=/fun-golf-service/adminUser/userDetail uri.adminUser.userDetail=/fun-golf-service/adminUser/userDetail
uri.adminUser.updatePassword=/fun-golf-service/adminUser/update uri.adminUser.updatePassword=/fun-golf-service/adminUser/update
uri.adminUser.communeAdmUserList = /fun-golf-service/adminUser/communeAdmUserList
# order # order
uri.order.placeOrder=/fun-golf-service/{orderType}/placeOrder uri.order.placeOrder=/fun-golf-service/{orderType}/placeOrder
...@@ -452,6 +453,16 @@ uri.communeExt.getByPhone=/fun-golf-service/communeExt/getByPhone ...@@ -452,6 +453,16 @@ uri.communeExt.getByPhone=/fun-golf-service/communeExt/getByPhone
uri.communeExt.getByCommuneNo=/fun-golf-service/communeExt/getByCommuneNo uri.communeExt.getByCommuneNo=/fun-golf-service/communeExt/getByCommuneNo
uri.communeExt.importCommuneExts=/fun-golf-service/communeExt/importCommuneExts uri.communeExt.importCommuneExts=/fun-golf-service/communeExt/importCommuneExts
#communeAdm
uri.communeAdm.list=/fun-golf-service/communeAdm/list
uri.communeAdm.batchBind=/fun-golf-service/communeAdm/batchBind
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
uri.WorkPoint.update=/fun-golf-service/userWorkPointLog/add uri.WorkPoint.update=/fun-golf-service/userWorkPointLog/add
......
...@@ -312,6 +312,9 @@ ${pageCss} ...@@ -312,6 +312,9 @@ ${pageCss}
<li <#if current == "sendMessage_create">class="active"</#if>> <li <#if current == "sendMessage_create">class="active"</#if>>
<a href="/sendMessage/create">发送短信</a> <a href="/sendMessage/create">发送短信</a>
</li> </li>
<li <#if current == "sendMessage_call">class="active"</#if>>
<a href="/sendMessage/call">快捷拨号</a>
</li>
<li class="nav-header">站内信息</li> <li class="nav-header">站内信息</li>
<li <#if current == "insideSms_create">class="active"</#if>> <li <#if current == "insideSms_create">class="active"</#if>>
...@@ -480,6 +483,16 @@ ${pageCss} ...@@ -480,6 +483,16 @@ ${pageCss}
<a href="/insuranceFinance/query">保险结算</a> <a href="/insuranceFinance/query">保险结算</a>
</li> </li>
</ul> </ul>
<#elseif module=="communeAdm">
<ul class="nav nav-list">
<li class="nav-header"社员管理</li>
<li <#if current == "communeAdm_list">class="active"</#if>>
<a href="/communeAdm/queryList">绑定管理员</a>
</li>
<li <#if current == "communeAdm_myBindList">class="active"</#if>>
<a href="/communeAdm/myBindList">我管理的社员</a>
</li>
</ul>
</#if> </#if>
</div> </div>
<!-- /well --> <!-- /well -->
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +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/myBindList">会服</a></li>
</ul> </ul>
<ul class="nav pull-right"> <ul class="nav pull-right">
......
<#assign pageJsContent>
<script>
$(function(){
$('#batchBind').click(function () {
var checkboxes = $('[name="datacheck"]:checked');
if (checkboxes.length == 0) {
alert("请选择要修改的资源");
} else {
$('#bindAdmModal').modal('show');
}
});
$('#bindAdmBtn').click(function () {
var checkboxes = $('[name="datacheck"]:checked');
var chgids="";
checkboxes.each(function () {
chgids = chgids + $(this).attr("id") + ",";
});
chgids = chgids.substr(0, chgids.length - 1);
var admUserId = $('#adminName').val();
$(this).button('loading');
$.post("/communeAdm/batchBind",{"communeExtIds":chgids,"admUserId":admUserId},function(msg){
if (msg['status'] == 0) {
location.reload();
}else{
alert(msg['message']);
$('#servicebtn').button("hide");
}
});
});
$('#batchUnbind').click(function () {
var checkboxes = $('[name="datacheck"]:checked');
var chgids="";
checkboxes.each(function () {
chgids = chgids + $(this).attr("id") + ",";
});
chgids = chgids.substr(0, chgids.length - 1);
$.post("/communeAdm/batchUnbind",{"communeExtIds":chgids},function(msg){
if (msg['status'] == 0) {
location.reload();
}else{
alert(msg['message']);
$('#servicebtn').button("hide");
}
});
});
});
$('#bindAdmModal').on('show.bs.modal', function (e) {
//模态框显示之后加载当前所有会服人员
$.get("/communeAdm/list/communeAdmUser",{},function(data){
//返回找出所有的会服
var html='<option value="0">请选择</option>';
for(var i=0;i<data.length;i++){
html+='<option value="'+data[i].admUserId+'">'+data[i].admUsername+'</option>'
}
$("#adminName").html(html);
})
});
//全选或者全不选
function shiftCheckAll(){
if($('#checkAll').is(':checked')) {
$(".J_shift :checkbox").prop("checked", true);
}else{
$(".J_shift :checkbox").prop("checked", false);
}
}
</script>
</#assign>
<#assign pageCssContent>
<style>
.table th, .table td{ text-align:center;vertical-align:middle;}
.widthShow {
width: 1100px;
}
</style>
</#assign>
<@com.layout title="查询公社会员" module="communeAdm" current="communeAdm_list" pageCss=pageCssContent pageJs=pageJsContent>
<form id="formId" class="form-inline search-box widthShow" action="/communeAdm/queryList" 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 />
<@com.textInput "dto.drawer" "style=\"margin-left: 5px;\"" "开单人"/>
<@com.textInput "dto.bindedAdm" "style=\"margin-left: 5px;\"" "绑定会服" />
<@com.textInputTwoDate "dto.communeAgainTimeStart" "dto.communeAgainTimeEnd" "" "社员到期时间"/>
<br />
<button type="submit" id="selectButton" class="btn btn-primary">查询</button>
<button type="button" id="batchBind" class="btn btn-primary">批量绑定</button>
<button type="button" id="batchUnbind" 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>${item.drawer!}</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.bindedAdm!}</td>
<td><#if item.bindTime??>${item.bindTime?string("yyyy-MM-dd HH:mm:ss")}</#if></td>
<td>
<!-- <a href="/communeAdm/update?id=${item.id!}&page=${paginationData.pageNumber}">修改</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="bindAdmModal" 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="row-fluid show-grid">
<div class="control-group ">
<label class="control-label" for="adminName">管理员</label>
<select id="adminName" name="adminName">
<option value="0">请选择</option>
</select>
</div>
</div>
<input type="hidden" id="rids" name="rids"/>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary pull-right bottom_margin" data-loading-text="执行中..."
id="bindAdmBtn">提交
</button>
</div>
</div>
</@com.layout>
\ No newline at end of file
<#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>
...@@ -321,6 +321,16 @@ $(function() { ...@@ -321,6 +321,16 @@ $(function() {
}); });
//拨打电话
function callTitle(phone){
$.post("/callcenter/sipPhone/originateOne",{"dst":phone},function(data){
if(data.errCode==0){
alert("正在为您拨号...");
}
});
}
</script> </script>
</#assign> </#assign>
...@@ -353,7 +363,8 @@ $(function() { ...@@ -353,7 +363,8 @@ $(function() {
</tr><tr> </tr><tr>
<td>性别</td><td>${bean.gender!}</td><td>生日</td><td>${bean.birth!}</td> <td>性别</td><td>${bean.gender!}</td><td>生日</td><td>${bean.birth!}</td>
</tr><tr> </tr><tr>
<td>手机号</td><td>${bean.mobilePhone!}</td><td>手机号归属地</td><td>${bean.city!} ${bean.province!}</td> <td>手机号</td><td>${bean.mobilePhone!}&nbsp;<button class="btn btn-default" onclick="callTitle('${bean.mobilePhone!}');" title="我们将会先拨通您的座机号码,再拨通对方的号码">拨打</button></td>
<td>手机号归属地</td><td>${bean.city!} ${bean.province!}</td>
</tr> </tr>
<tr> <tr>
<td>账户余额</td> <td>账户余额</td>
......
<#assign pageJsContent>
</#assign>
<@com.layout title="快捷拨号" module="tools" current="sendMessage_call" pageJs=pageJsContent>
<form class="form-inline form-horizontal" action="${action}" method="post">
<#if returnPage??>
<input type="hidden" id="returnPage" name="returnPage" value="${returnPage}"/>
</#if>
<div id="course_container">
<div class="row-fluid show-grid">
<h3 class="open span12" data-collapse-summary="" aria-expanded="true">快捷拨号</h3>
<div class="feature_content">
<div class="long_content_div control-group ">
<label class="control-label" for="mobileNos">请输入手机号</label>
<div class="controls">
<input type="text" id="mobileNos" name="mobileNos" value="" placeholder="请输入手机号" required="" "="">
</div>
</div>
</div>
<button type="button" class="btn btn-primary pull-left bottom_margin" onclick="callTitle();">拨号</button>
</div>
</div>
</form>
<script>
//拨打电话
function callTitle(){
var phone= $("#mobileNos").val();
if(phone==""||phone=="undefinded"){
return alert("请输入手机号码!");
}
$.post("/callcenter/sipPhone/originateOne",{"dst":phone},function(data){
if(data.errCode==0){
alert("正在为您拨号...");
}
});
}
</script>
</@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