use of com.itrus.portal.db.CustomerService in project portal by ixinportal.
the class CustomerServiceCallWebContoller method telephoneQuery.
/**
* 获取客服电话,跳转电话页面
* @param eid 客服id
* @param uiModel
* @param request
* @return
*/
@RequestMapping(value = "/telephoneQuery/index/{eid}", produces = "text/html")
public String telephoneQuery(@PathVariable("eid") Long eid, Model uiModel, HttpServletRequest request) {
HttpSession session = request.getSession();
EnterpriseQq enterpriseqq = enterpriseqqService.selectOne(eid);
uiModel.addAttribute("enterpriseqq", enterpriseqq);
session.removeAttribute("enterpriseqqE");
if (enterpriseqq != null && enterpriseqq.getEnterpriseQqLinks() != null) {
session.setAttribute("enterpriseqqE", enterpriseqq.getEnterpriseQqLinks());
}
List<CustomerService> customerlist = new ArrayList<CustomerService>();
Project project = new Project();
if (enterpriseqq != null) {
String sid = enterpriseqq.getId().toString();
int id = Integer.parseInt(sid);
CustomerServiceExample customer = new CustomerServiceExample();
CustomerServiceExample.Criteria serviceEx = customer.createCriteria();
serviceEx.andEnterpriseIdEqualTo(id);
customerlist = sqlSession.selectList("com.itrus.portal.db.CustomerServiceMapper.selectByExample", customer);
// 获取项目
project = sqlSession.selectOne("com.itrus.portal.db.ProjectMapper.selectByPrimaryKey", enterpriseqq.getProjectId());
}
uiModel.addAttribute("customerlist", customerlist);
uiModel.addAttribute("project", project);
return "ixinweb/kehufuwu_kefudianhua";
}
use of com.itrus.portal.db.CustomerService in project portal by ixinportal.
the class OnlineServiceController method establishCustomerService.
/*
* 创建客服
*
*/
@RequestMapping(produces = "text/html", params = "form")
public String establishCustomerService(Model model) {
// 管理员项目权限
Long[] projectsOfAdmin = getProjectLongIdsOfAdmin();
List<Map<String, Object>> projectIds = onlineService.getProjects();
List<Long> pids = new ArrayList<>();
for (Map<String, Object> p : projectIds) {
if (p != null) {
Long project_id = (Long) p.get("project_id");
pids.add(project_id);
}
}
model.addAttribute("pids", pids);
// 查询默认客服的数据
EnterpriseQqExample enterpriseE = new EnterpriseQqExample();
EnterpriseQqExample.Criteria qqEx = enterpriseE.createCriteria();
qqEx.andEnterpriseQqStateEqualTo(0L);
EnterpriseQq enterpriseqq = onlineService.selectQq(enterpriseE);
// 查询默认客服的数据
CustomerServiceExample customerE = new CustomerServiceExample();
CustomerServiceExample.Criteria serviceE = customerE.createCriteria();
serviceE.andServiceStateEqualTo(0);
CustomerService customerService = onlineService.selectService(customerE);
if (customerService == null) {
model.addAttribute("customerstatus", 1);
}
if (enterpriseqq == null) {
model.addAttribute("qqstatus", 1);
}
ProjectExample projectE = new ProjectExample();
ProjectExample.Criteria pec = projectE.createCriteria();
pec.andIdIn(Arrays.asList(projectsOfAdmin));
List<Project> projectlist = projectService.getProjectByExample(projectE);
// Map<Long,Project> projectlist= onlineService.selectProject();
model.addAttribute("projectlist", projectlist);
return "onlineservices/create";
}
use of com.itrus.portal.db.CustomerService in project portal by ixinportal.
the class OnlineServiceController method selectProject.
@RequestMapping(produces = "text/html")
public String selectProject(@RequestParam(value = "queryDate1", required = false) Date queryDate1, @RequestParam(value = "queryDate2", required = false) Date queryDate2, @RequestParam(value = "projectId", required = false) Long projectId, @RequestParam(value = "phone", required = false) String phone, @RequestParam(value = "enterpriseQq", required = false) String enterpriseQq, @RequestParam(value = "page", required = false) Integer page, @RequestParam(value = "size", required = false) Integer size, @RequestParam(value = "status", required = false) String status, Model uiModel) {
if (queryDate1 == null && queryDate2 == null) {
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.DATE, 1);
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
calendar.add(Calendar.MILLISECOND, -1);
queryDate2 = calendar.getTime();
calendar.add(Calendar.MILLISECOND, 1);
calendar.add(Calendar.MONTH, -1);
queryDate1 = calendar.getTime();
}
// 管理员项目权限
Long[] projectsOfAdmin = getProjectLongIdsOfAdmin();
Map param = new HashMap();
param.put("hasProjects", Arrays.asList(projectsOfAdmin));
if (page == null || page < 1)
page = 1;
if (size == null || size < 1)
size = 10;
Integer offset = size * (page - 1);
param.put("offset", offset);
param.put("limit", size);
param.put("queryDate1", queryDate1);
param.put("queryDate2", queryDate2);
if (projectId != null) {
param.put("projectId", projectId);
}
if (StringUtils.isNotEmpty(phone)) {
param.put("phone", "%" + phone + "%");
}
if (StringUtils.isNotEmpty(enterpriseQq)) {
param.put("enterpriseQq", "%" + enterpriseQq + "%");
}
// 查詢qq客服
List<Map<String, Object>> enterpriseqQq = onlineService.selectQqList(param);
// 得到數量
int count = onlineService.selectcount(param);
uiModel.addAttribute("pages", (count + size - 1) / size);
if (page > 1 && size * (page - 1) >= count) {
page = (count + size - 1) / size;
}
Map<Long, List<CustomerService>> listmain = new HashMap<Long, List<CustomerService>>();
for (int i = 0; i < enterpriseqQq.size(); i++) {
long id = Long.parseLong(enterpriseqQq.get(i).get("id").toString());
CustomerServiceExample customerE = new CustomerServiceExample();
CustomerServiceExample.Criteria serviceE = customerE.createCriteria();
int cid = Integer.parseInt(enterpriseqQq.get(i).get("id").toString());
serviceE.andEnterpriseIdEqualTo(cid);
List<CustomerService> listcustomer = onlineService.selectServiceList(customerE);
listmain.put(id, listcustomer);
}
ProjectExample projectE = new ProjectExample();
ProjectExample.Criteria pec = projectE.createCriteria();
pec.andIdIn(Arrays.asList(projectsOfAdmin));
List<Project> project = projectService.getProjectByExample(projectE);
uiModel.addAttribute("listQq", enterpriseqQq);
uiModel.addAttribute("listmain", listmain);
uiModel.addAttribute("list", project);
// 查询默认客服的数据
EnterpriseQqExample enterpriseE = new EnterpriseQqExample();
EnterpriseQqExample.Criteria qqEx = enterpriseE.createCriteria();
qqEx.andEnterpriseQqStateEqualTo(0L);
EnterpriseQq enterpriseqq = onlineService.selectQq(enterpriseE);
// 查询默认客服的数据
CustomerServiceExample customerE = new CustomerServiceExample();
CustomerServiceExample.Criteria serviceE = customerE.createCriteria();
serviceE.andServiceStateEqualTo(0);
CustomerService customerService = onlineService.selectService(customerE);
uiModel.addAttribute("enterpriseqq", enterpriseqq);
uiModel.addAttribute("customerService", customerService);
uiModel.addAttribute("count", count);
uiModel.addAttribute("queryDate1", queryDate1);
uiModel.addAttribute("queryDate2", queryDate2);
uiModel.addAttribute("projectId", projectId);
uiModel.addAttribute("phone", phone);
uiModel.addAttribute("enterpriseQq", enterpriseQq);
uiModel.addAttribute("size", size);
uiModel.addAttribute("page", page);
return "onlineservices/list";
}
use of com.itrus.portal.db.CustomerService in project portal by ixinportal.
the class OnlineServiceController method delete.
// 删除
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE, produces = "text/html")
@ResponseBody
public String delete(@PathVariable("id") Long id, HttpServletRequest request, Model uiModel) {
// System.out.println("删除");
EnterpriseQq enterprise = onlineService.selectEnterprise(id);
if (enterprise != null) {
CustomerServiceExample customerE = new CustomerServiceExample();
CustomerServiceExample.Criteria serviceE = customerE.createCriteria();
int cid = Integer.parseInt(enterprise.getId().toString());
serviceE.andEnterpriseIdEqualTo(cid);
List<CustomerService> listcustomer = onlineService.selectServiceList(customerE);
if (listcustomer.size() > 0) {
for (CustomerService cus : listcustomer) {
onlineService.deleteId(cus.getId());
}
}
onlineService.deleteById(id);
LogUtil.adminlog(sqlSession, "删除天威客服", enterprise.getProjectId() + "删除的文件是:" + enterprise.getEnterpriseQq());
} else {
return "为找到相应的qq";
}
return null;
}
use of com.itrus.portal.db.CustomerService in project portal by ixinportal.
the class OnlineServiceController method updateshow.
/**
* 跳转修改页面
*
* @param id
* @return
*/
@RequestMapping(value = "/updateshow/{id}", produces = "text/html")
public String updateshow(@PathVariable("id") Long id, Model uiModel) {
EnterpriseQq enterprise = onlineService.selectEnterprise(id);
// Long qq_state=enterprise.getQqState();
// Long custerm_service_state=enterprise.getCustermServiceState();
// Map<Long, List<CustomerService>> listmain = new HashMap<Long,
// List<CustomerService>>();
CustomerServiceExample customerE = new CustomerServiceExample();
CustomerServiceExample.Criteria serviceE = customerE.createCriteria();
int cid = Integer.parseInt(enterprise.getId().toString());
serviceE.andEnterpriseIdEqualTo(cid);
List<CustomerService> listcustomer = onlineService.selectServiceList(customerE);
// CustomerServiceExample customerE = new CustomerServiceExample();
// List<CustomerService> customerService =
// onlineService.selectServiceList(customerE);
Map<Long, Object> map = new HashMap<>();
String json = "";
for (CustomerService c : listcustomer) {
String str = null;
try {
str = jsonTool.writeValueAsString(c);
ObjectMapper mapper = new ObjectMapper();
json = mapper.writeValueAsString(map);
} catch (Exception e) {
e.printStackTrace();
}
map.put(c.getId(), str);
}
try {
uiModel.addAttribute("json", jsonTool.writeValueAsString(json));
uiModel.addAttribute("json1", jsonTool.writeValueAsString(listcustomer));
} catch (Exception e) {
e.printStackTrace();
}
ProjectExample projectE = new ProjectExample();
List<Project> project = projectService.getProjectByExample(projectE);
// 查询默认客服的数据
EnterpriseQqExample enterpriseE = new EnterpriseQqExample();
EnterpriseQqExample.Criteria qqEx = enterpriseE.createCriteria();
qqEx.andEnterpriseQqStateEqualTo(0L);
EnterpriseQq enterpriseqq = onlineService.selectQq(enterpriseE);
// 查询默认客服的数据
CustomerServiceExample customerEX = new CustomerServiceExample();
CustomerServiceExample.Criteria serviceEX = customerEX.createCriteria();
serviceEX.andServiceStateEqualTo(0);
CustomerService customerService = onlineService.selectService(customerEX);
if (customerService == null) {
uiModel.addAttribute("customerstatus", 1);
}
if (enterpriseqq == null) {
uiModel.addAttribute("qqstatus", 1);
}
uiModel.addAttribute("enterprise", enterprise);
uiModel.addAttribute("listcustomer", listcustomer);
uiModel.addAttribute("projectList", project);
return "onlineservices/update";
}
Aggregations