package com.pb.system.action;
import java.util.*;
import com.opensymphony.xwork2.ActionSupport;
import com.pb.client.entity.AwayClient;
import com.pb.client.entity.Client;
import com.pb.client.entity.ContactRecord;
import com.pb.client.entity.HistoryOrder;
import com.pb.client.entity.Linkman;
import com.pb.client.entity.OrderDetail;
import com.pb.client.service.AwayClientService;
import com.pb.client.service.ClientService;
import com.pb.client.service.ContactRecordService;
import com.pb.client.service.HistoryOrderService;
import com.pb.client.service.LinkmanService;
import com.pb.client.service.OrderDetailService;
import com.pb.market.entity.MarketChance;
import com.pb.market.entity.MyPlan;
import com.pb.market.service.MarketChanceService;
import com.pb.market.service.MyPlanService;
import com.pb.serve.entity.Servemanager;
import com.pb.serve.service.ServemanagerService;
import com.pb.system.entity.Dictionary;
import com.pb.system.service.DictionaryService;
import com.pb.util.Page;
public class DictionaryAction extends ActionSupport{
private DictionaryService dictionaryService;
private ClientService clientService;
private ServemanagerService servemanagerService;
private AwayClientService awayClientService;
private OrderDetailService orderDetailService;
private LinkmanService linkmanService;
private ContactRecordService contactRecordService;
private HistoryOrderService historyOrderService;
private MarketChanceService marketChanceService;
private MyPlanService myPlanService;
private Page page;
private Integer pageIndex;
private Dictionary dictionary;
private Dictionary editDic;
private Integer dicId;
private String type;
public DictionaryService getDictionaryService() {
return dictionaryService;
}
public void setDictionaryService(DictionaryService dictionaryService) {
this.dictionaryService = dictionaryService;
}
public ClientService getClientService() {
return clientService;
}
public void setClientService(ClientService clientService) {
this.clientService = clientService;
}
public ServemanagerService getServemanagerService() {
return servemanagerService;
}
public void setServemanagerService(ServemanagerService servemanagerService) {
this.servemanagerService = servemanagerService;
}
public AwayClientService getAwayClientService() {
return awayClientService;
}
public void setAwayClientService(AwayClientService awayClientService) {
this.awayClientService = awayClientService;
}
public OrderDetailService getOrderDetailService() {
return orderDetailService;
}
public void setOrderDetailService(OrderDetailService orderDetailService) {
this.orderDetailService = orderDetailService;
}
public LinkmanService getLinkmanService() {
return linkmanService;
}
public void setLinkmanService(LinkmanService linkmanService) {
this.linkmanService = linkmanService;
}
public ContactRecordService getContactRecordService() {
return contactRecordService;
}
public void setContactRecordService(ContactRecordService contactRecordService) {
this.contactRecordService = contactRecordService;
}
public HistoryOrderService getHistoryOrderService() {
return historyOrderService;
}
public void setHistoryOrderService(HistoryOrderService historyOrderService) {
this.historyOrderService = historyOrderService;
}
public MarketChanceService getMarketChanceService() {
return marketChanceService;
}
public void setMarketChanceService(MarketChanceService marketChanceService) {
this.marketChanceService = marketChanceService;
}
public MyPlanService getMyPlanService() {
return myPlanService;
}
public void setMyPlanService(MyPlanService myPlanService) {
this.myPlanService = myPlanService;
}
public Page getPage() {
return page;
}
public void setPage(Page page) {
this.page = page;
}
public Integer getPageIndex() {
return pageIndex;
}
public void setPageIndex(Integer pageIndex) {
this.pageIndex = pageIndex;
}
public Dictionary getDictionary() {
return dictionary;
}
public void setDictionary(Dictionary dictionary) {
this.dictionary = dictionary;
}
public Dictionary getEditDic() {
return editDic;
}
public void setEditDic(Dictionary editDic) {
this.editDic = editDic;
}
public Integer getDicId() {
return dicId;
}
public void setDicId(Integer dicId) {
this.dicId = dicId;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
/**
* 查询客户等级集合(分页)
*/
public String findGradeByPage() throws Exception{
if(this.dictionary==null){
this.dictionary=new Dictionary();
}
this.type="客户等级";
this.dictionary.setType(type);
this.page = this.dictionaryService.findByPage(dictionary,this.pageIndex == null ? 1 : pageIndex);
this.dictionary=null;
return "success";
}
/**
* 查询客户地区信息(分页)
*/
public String findDistrictByPage() throws Exception{
if(this.dictionary==null){
this.dictionary=new Dictionary();
}
this.type="客户地区";
this.dictionary.setType(type);
this.page = this.dictionaryService.findByPage(dictionary,this.pageIndex == null ? 1 : pageIndex);
this.dictionary=null;
return "success";
}
/**
* 查询服务类型信息(分页)
*/
public String findServeByPage() throws Exception{
if(this.dictionary==null){
this.dictionary=new Dictionary();
}
this.type="服务类型";
this.dictionary.setType(type);
this.page = this.dictionaryService.findByPage(dictionary,this.pageIndex == null ? 1 : pageIndex);
this.dictionary=null;
return "success";
}
/**
* 查询数据字典的集合(分页)
*//*
public String findByPage() throws Exception {
this.page = this.dictionaryService.findByPage(this.dictionary == null ? new Dictionary() : dictionary,this.pageIndex == null ? 1 : pageIndex);
return SUCCESS;
}*/
/**
* 通过Id查找数据字典
*/
public String edit() throws Exception {
this.editDic = this.dictionaryService.findById(dicId);
return "edit";
}
/**
* 编辑数据字典
*/
public String updateOrSave() throws Exception {
if (editDic.getId() == null) {
System.out.println(type);
editDic.setType(type);
this.dictionaryService.save(editDic);
editDic = null;
} else {
this.dictionaryService.update(editDic);
editDic = null;
}
if(type.equals("客户地区")){
return "display1";
}else if(type.equals("客户等级")){
return "display2";
}else{
return "display3";
}
}
/**
* 删除数据字典
*/
public String delete() throws Exception {
Dictionary dic = this.dictionaryService.findById(dicId);
this.type=dic.getType();
if (dic.getDistrictClients() != null) {
for (Client c : dic.getDistrictClients()) {
if (c.getAwayClients() != null) {
for (AwayClient a : c.getAwayClients()) {
awayClientService.delete(a);
}
}
if (c.getServemanagers() != null) {
for (Servemanager s : c.getServemanagers()) {
servemanagerService.delete(s);
}
}
for (Linkman l : c.getLinkmans()) {
for (MarketChance m : l.getMarketChances()) {
for (MyPlan p : m.getMyplan()) {
myPlanService.delete(p);
}
marketChanceService.delete(m);
}
linkmanService.delete(l);
}
Set<HistoryOrder> setOrder = c.getHistoryOrders();
Iterator<HistoryOrder> his = setOrder.iterator();
while (his.hasNext()) {
List <OrderDetail> de =orderDetailService.getProductById(his.next());
Iterator<OrderDetail> detail = de.iterator();
while (detail.hasNext()) {
orderDetailService.delete(detail.next());
}
}
Set<ContactRecord> setCR = c.getContactRecords();
Iterator<ContactRecord> ic = setCR.iterator();
while (ic.hasNext()) {
contactReco
没有合适的资源?快使用搜索试试~ 我知道了~
北大青鸟 CRM客户关系管理系统
共459个文件
java:101个
class:101个
gif:58个
4星 · 超过85%的资源 需积分: 10 30 下载量 4 浏览量
2014-05-14
22:01:42
上传
评论 2
收藏 21.68MB ZIP 举报
温馨提示
SSH框架,Oracle数据库,Tomcat服务器,jsp,jQuery,dwr,开发工具是Eclipse,另外数据库表也附上了,里面还有测试数据。欢迎下载哦!!
资源推荐
资源详情
资源评论
收起资源包目录
北大青鸟 CRM客户关系管理系统 (459个子文件)
DictionaryAction.class 14KB
ClientAction.class 14KB
MarketChanceAction.class 10KB
ServeAction.class 10KB
Client.class 8KB
ItemAction.class 6KB
RoleAction.class 6KB
AwayClientAction.class 6KB
UsersAction.class 5KB
MarketChance.class 4KB
MyPalnAction.class 4KB
HistoryOrderAction.class 4KB
Dictionary.class 4KB
Servemanager.class 4KB
UpdateClientAction.class 4KB
IBaseDaoImpl.class 4KB
LinkmanAction.class 4KB
ContactRecordAction.class 4KB
UsersServiceImpl.class 3KB
Linkman.class 3KB
AwayClientDaoImpl.class 3KB
LinkmanDaoImpl.class 3KB
HistoryOrder.class 3KB
AwayClient.class 2KB
UsersDaoImpl.class 2KB
Item.class 2KB
Product.class 2KB
Users.class 2KB
DictionaryDaoImpl.class 2KB
ContactRecord.class 2KB
HistoryOrderServiceImpl.class 2KB
LinkmanServiceImpl.class 2KB
DictionaryServiceImpl.class 2KB
ContactRecordServiceImpl.class 2KB
StockAction.class 2KB
ClientDaoImpl.class 2KB
ProductAction.class 2KB
ServeUtilDaoImpl.class 2KB
AwayClientServiceImpl.class 2KB
Stock.class 2KB
OrderDetailServiceImpl.class 2KB
ServemanagerServiceImpl.class 2KB
MarketChanceDaoImpl.class 2KB
HistoryOrderDaoImpl.class 2KB
Role.class 2KB
ClientServiceImpl.class 2KB
RoleServiceImpl.class 2KB
ServeUtil.class 2KB
MarketChanceServiceImpl.class 2KB
MyPlan.class 2KB
OrderDetailDaoImpl.class 1KB
MyPlanServiceImpl.class 1KB
OrderDetail.class 1KB
ItemServiceImpl.class 1KB
Page.class 1KB
ContactRecordDaoImpl.class 1KB
ProductDaoImpl.class 1KB
StockDaoImpl.class 1KB
RoleDaoImpl.class 1KB
Test.class 1KB
ServeUtilServiceImpl.class 884B
ProductServiceImpl.class 863B
StockServiceImpl.class 839B
HistoryOrderService.class 717B
LinkmanService.class 712B
BaseAction.class 707B
UsersService.class 687B
DictionaryService.class 668B
ContactRecordService.class 664B
OrderDetailService.class 652B
IBaseDao.class 649B
AwayClientService.class 591B
ServemanagerDaoImpl.class 533B
ServemanagerService.class 503B
MyPlanDaoImpl.class 502B
HistoryOrderDao.class 496B
ItemDaoImpl.class 490B
ClientService.class 472B
OrderDetailDao.class 465B
RoleService.class 461B
DictionaryDao.class 452B
ContactRecordDao.class 439B
LinkmanDao.class 415B
MyPlanService.class 399B
MarketChanceService.class 392B
ItemService.class 388B
AwayClientDao.class 376B
Constant.class 326B
MarketChanceDao.class 287B
ServemanagerDao.class 285B
ServeUtilDao.class 276B
ProductDao.class 270B
ClientDao.class 269B
MyPlanDao.class 269B
UsersDao.class 266B
StockDao.class 264B
ItemDao.class 263B
RoleDao.class 263B
ServeUtilService.class 210B
ProductService.class 204B
共 459 条
- 1
- 2
- 3
- 4
- 5
资源评论
- zt20142014-10-21项目中Tomcat服务器配不上Tomcat6 和Tomcat7都试了 不知道你的服务器是什么版本的
- jiurangnizou2014-07-13还不错,但运行起来有点问题
2vcoder
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功