package com.amssy.crm.chance.service.impl;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.amssy.common.dao.PagingObject;
import com.amssy.common.service.impl.BaseManager;
import com.amssy.crm.chance.dao.ChanceBelongDAO;
import com.amssy.crm.chance.dao.ChanceDAO;
import com.amssy.crm.chance.dao.ChanceRecordDAO;
import com.amssy.crm.chance.dao.ChanceStatusDAO;
import com.amssy.crm.chance.model.ChanceBelongDTO;
import com.amssy.crm.chance.model.ChanceDTO;
import com.amssy.crm.chance.model.ChanceRecordDTO;
import com.amssy.crm.chance.model.ChanceStatusDTO;
import com.amssy.crm.chance.model.PrepChanceDTO;
import com.amssy.crm.chance.service.ChanceCalculateService;
import com.amssy.crm.chance.service.ChanceService;
import com.amssy.crm.chance.service.PrepChanceService;
import com.amssy.crm.customer.model.CustomerBelongDTO;
import com.amssy.crm.customer.model.CustomerRecordDTO;
import com.amssy.crm.customer.model.CustomerStatusDTO;
import com.amssy.crm.customer.service.CustomerService;
import com.amssy.crm.org.service.OrganizationService;
import com.amssy.crm.plan.model.PlanDTO;
import com.amssy.crm.plan.model.PlanRecordDTO;
import com.amssy.crm.plan.model.PlanStatusDTO;
import com.amssy.crm.plan.service.PlanService;
import com.amssy.crm.record.model.RecordDTO;
import com.amssy.crm.system.model.BaseInfoDTO;
import com.amssy.crm.system.service.BaseInfoService;
import com.amssy.crm.system.util.BaseInfoUtil;
import com.amssy.crm.tryout.model.TryoutAndProductDTO;
import com.amssy.crm.tryout.model.TryoutDTO;
import com.amssy.crm.tryout.service.TryoutService;
import com.amssy.extra.hr.model.EmployeeDTO;
/**
* Chance Service business interface
*
* @spring.bean id="chanceService"
* @spring.property name="chanceDAO" ref="chanceDAO"
* @spring.property name="chanceRecordDAO" ref="chanceRecordDAO"
* @spring.property name="chanceStatusDAO" ref="chanceStatusDAO"
* @spring.property name="chanceBelongDAO" ref="chanceBelongDAO"
* @spring.property name="prepChanceService" ref="prepChanceService"
* @spring.property name="chanceCalculateService" ref="chanceCalculateService"
* @spring.property name="customerService" ref="customerService"
* @spring.property name="tryoutService" ref="tryoutService"
* @spring.property name="planService" ref="planService"
* @spring.property name="organizationService" ref="organizationService"
* @spring.property name="baseInfoService" ref="baseInfoService"
* @author Conan
* @date 2008-8-26
*/
public class ChanceServiceImpl extends BaseManager implements ChanceService {
private ChanceDAO chanceDAO;
private ChanceRecordDAO chanceRecordDAO;
private ChanceStatusDAO chanceStatusDAO;
private ChanceBelongDAO chanceBelongDAO;
private PrepChanceService prepChanceService;
private ChanceCalculateService chanceCalculateService;
private CustomerService customerService;
private TryoutService tryoutService;
private PlanService planService;
private OrganizationService organizationService;
private BaseInfoService baseInfoService;
public ChanceDTO getChanceById(Long chanceId) throws Exception {
return chanceDAO.getChanceById(chanceId);
}
public ChanceStatusDTO getChanceStatusById(Long chanceId) throws Exception {
return chanceStatusDAO.getChanceStatusById(chanceId);
}
/**
* map:cmrId
*/
public List getChanceIdByCmrId(Map map) throws Exception{
return chanceDAO.getAllChanceList(map);
}
public int createChanceZero(Long cmrId,String ani,Integer stordId) throws Exception{
ChanceDTO chance = new ChanceDTO();
chance.setAni(ani);
chance.setCmrId(cmrId);
chance.setChaOri(BaseInfoUtil.CHAORI_CHAZERO);
chance.setChaOriType(BaseInfoUtil.CHAORITYPE_DATAMINING.getId());
chance.setChaPha(BaseInfoUtil.CHAPHA_CHACLT);
chance.setChaType(BaseInfoUtil.CHATYPE_CHAZERO);
chance.setChaReqType(new BaseInfoDTO(new Integer(101)));
chance.setChaPurp(new BaseInfoDTO(new Integer(111)));
chance.setPdtNum("0000");
chance.setChaPriPdtName("No product");
ChanceRecordDTO chaRecord = new ChanceRecordDTO();
chaRecord.setChance(chance);
chaRecord.setChaPha(BaseInfoUtil.CHAPHA_CHACLT);
chaRecord.setChaRecDesc("Zero Chance");
chaRecord.setChaUpdOnrId(new Long(-5000));//system self
chaRecord.setChaStat(BaseInfoUtil.CHASTAT_CHACREATE);
chaRecord.setRecOpType(BaseInfoUtil.CHAOPTYPE_CHACREATE);
ChanceStatusDTO chaStatus = new ChanceStatusDTO();
chaStatus.setChance(chance);
chaStatus.setChaStat(BaseInfoUtil.CHASTAT_CHACREATE);
chaStatus.setStoreId(stordId);
return createChance(chance,chaRecord,chaStatus);
}
/**
* Createa a chance
*/
public int createChance(ChanceDTO chance, ChanceRecordDTO chaRecord, ChanceStatusDTO chaStatus) throws Exception {
int tmp = 0;
try {
/*
* insert chance, chanceStatus, chanceRecord
*/
chance.setChaStat(BaseInfoUtil.CHASTAT_CHACREATE.getId());
chaStatus.setChaStat(BaseInfoUtil.CHASTAT_CHACREATE);
chaRecord.setRecOpType(BaseInfoUtil.CHAOPTYPE_CHACREATE);
chance.setChaSucPbt(new Float(chanceCalculateService.calculateSuccessProbability(chance, ChanceCalculateService.CHASUCPBT_CREATE)));
chance.setChaPotlVal(new Double(chanceCalculateService.calculatePotentialValue(chance)));
chance.setChaPrt(new Float(chanceCalculateService.calculatePriority(chance)));
ChanceDTO cha = chanceDAO.insertChance(chance);
chaRecord.setChance(cha);
chaRecord.setChaStat(BaseInfoUtil.CHASTAT_CHACREATE);
chanceRecordDAO.insertChanceRecord(chaRecord);
chaStatus.setChance(cha);
int chaStat = chanceStatusDAO.insertChanceStatus(chaStatus);
if (chaStat != 0) {
tmp = 1;
}
} catch (Exception ex) {
log.error(ex.getMessage());
throw ex;
}
return tmp;
}
public int createChanceWithTryoutAndPlan(ChanceDTO chance, ChanceRecordDTO chaRecord, ChanceStatusDTO chaStatus, Map tytMap, List planList) throws Exception {
int tmp = 0;
try {
/*
* insert chance, chanceStatus, chanceRecord
*/
chance.setChaStat(BaseInfoUtil.CHASTAT_CHACREATE.getId());
chaStatus.setChaStat(BaseInfoUtil.CHASTAT_CHACREATE);
chaRecord.setRecOpType(BaseInfoUtil.CHAOPTYPE_CHACREATE);
chance.setChaSucPbt(new Float(chanceCalculateService.calculateSuccessProbability(chance, ChanceCalculateService.CHASUCPBT_CREATE)));
chance.setChaPotlVal(new Double(chanceCalculateService.calculatePotentialValue(chance)));
chance.setChaPrt(new Float(chanceCalculateService.calculatePriority(chance)));
ChanceDTO cha = chanceDAO.insertChance(chance);
chaRecord.setChance(cha);
chaRecord.setChaStat(BaseInfoUtil.CHASTAT_CHACREATE);
chanceRecordDAO.insertChanceRecord(chaRecord);
chaStatus.setChance(cha);
int chaStat = chanceStatusDAO.insertChanceStatus(chaStatus);
if (chaStat != 0) {
if(tytMap!=null){
TryoutDTO tytDto = (TryoutDTO) tytMap.get("TryoutDTO");
tytDto.setRefId(cha.getId());
tytDto.setStoreId(chaStatus.getStoreId());
TryoutAndProductDTO[] tytPro = (TryoutAndProductDTO[]) tytMap.get("TryoutAndProductDTOs");
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
主要内容: 1,完完整整的CRM系统代码,含页面和数据库脚本; 2,功能模块包括:广告,机会,客户,订单,投诉,会员卡,计划,组织,试用装,呼叫及通话记录,使用记录,问卷调查,系统,缓存等等。 3,含调用API,代码模板,代码检测等等。 4,提供系统集成和人事对接等扩展接口模块。 5,技术栈:ExtJS+Servlet+Spring+Ibatis以及oscache、log4j等。 6,可供修改后商用,也可作为学习参考,也可作为毕业设计。
资源推荐
资源详情
资源评论
收起资源包目录
一份CRM客户关系管理系统的Java源代码 (1677个子文件)
sqlList.bat 2KB
run.bat 252B
getfile.bat 110B
ChanceServiceImpl.class 22KB
CustomerServiceImpl.class 21KB
TryoutServiceImpl.class 13KB
CustomerServiceImplTest.class 12KB
OrganizationServiceImpl.class 12KB
CustomerDetailInfoDTO.class 11KB
PlanServiceImpl.class 10KB
AddressServiceImpl.class 10KB
ProductDAOIbatis.class 9KB
MemberCardDAOIbatisTest.class 9KB
MemberCardServiceImplTest.class 9KB
ProductServiceImpl.class 9KB
ChanceServiceImplTest.class 9KB
AdvChanceServiceImpl.class 8KB
TalkHistServiceImpl.class 8KB
OrdersDTO.class 8KB
OrganizationServiceImplTest.class 8KB
MemberCardDAOIbatis.class 7KB
BuildHRTreeServiceImplTest.class 7KB
MemberCardServiceImpl.class 7KB
TraverseHRTreeServiceImplTest.class 6KB
PrepChanceServiceImpl.class 6KB
TryoutAndProductDAOIbatis.class 6KB
ComplainServiceImpl.class 6KB
ChanceDAOIbatisTest.class 6KB
ComplainServiceImplTest.class 6KB
AddressDAOIbatis.class 5KB
CustomerAdvanceSearchDAOIbatis.class 5KB
PlanStatusDAOIbatisTest.class 5KB
ChanceStatusDAOIbatisTest.class 5KB
AdvChanceServiceTest.class 5KB
ChanceDTO.class 5KB
TestBonusInvoke.class 5KB
BaseInfoDAOIbatis.class 5KB
BaseTypeDAOIbatis.class 5KB
PlanRecordDAOIbatis.class 5KB
XsurveyServiceImpl.class 5KB
ChanceBelongDAOIbatisTest.class 5KB
ChanceDAOIbatis.class 5KB
AdProductServiceImpl.class 5KB
TraverseHRTreeServiceImpl.class 5KB
ChanceOriginServiceImplTest.class 5KB
AddressDTO.class 5KB
ComplainDAOIbatisTest.class 4KB
TryoutDAOIbatis.class 4KB
ChanceOriginDAOIbatisTest.class 4KB
PlanStatusDAOIbatis.class 4KB
ChanceCalculateServiceImpl.class 4KB
PrepChanceServiceImplTest.class 4KB
PlanRecordDAOIbatisTest.class 4KB
CustomerAssignmentDTO.class 4KB
ComplainRecordDAOIbatisTest.class 4KB
MemberCardDTO.class 4KB
TryoutAndProductServiceServiceImpl.class 4KB
ChanceRecordDAOIbatis.class 4KB
ComplainDAOIbatis.class 4KB
ChanceRecordDAOTest.class 4KB
ChanceOriginDAOIbatis.class 4KB
TryoutDTO.class 4KB
AdProductDAOIbatis.class 4KB
AddrBookServiceImpl.class 4KB
ProductServiceImplTest.class 4KB
CacheAccessor.class 4KB
CustomerAdvanceSearchDAOIbatisTest.class 4KB
ProductDAOIbatisTest.class 4KB
CacheHRTreeServiceImpl.class 4KB
PrepChanceDAOIbatis.class 4KB
ChanceBelongDAOIbatis.class 4KB
ComplainRecordDAOIbatis.class 4KB
ComplainBelongDAOIbatis.class 4KB
BizCacheServiceImpl.class 4KB
XsurveyDAOIbatis.class 4KB
ComplainBelongDAOIbatisTest.class 4KB
BaseInfoServiceImpl.class 4KB
XsurveyDAOIbatisTest.class 4KB
CallHistDTO.class 4KB
PlanDTO.class 4KB
EmployeeDTO.class 4KB
PlanDAOIbatis.class 4KB
HRMainRun.class 4KB
TryoutDAOIbatisTest.class 4KB
RecordDAOIbatis.class 4KB
TalkHistDAOIbatisTest.class 4KB
AddressDAOIbatisTest.class 4KB
TryoutServiceImplTest.class 3KB
UserRegDTO.class 3KB
ChanceStatusDAOIbatis.class 3KB
PlanServiceImplTest.class 3KB
ChanceOriginServiceImpl.class 3KB
PlanDAOIbatisTest.class 3KB
CustomerSimpleSearchDAOIbatisTest.class 3KB
AddressServiceImplTest.class 3KB
TranferDTOServiceImpl.class 3KB
ChanceCalculateServiceImplTest.class 3KB
ComplainDTO.class 3KB
CustomerAssignmentSearchDAOIbatisTest.class 3KB
CustomerRetrieveSearchDAOIbatisTest.class 3KB
共 1677 条
- 1
- 2
- 3
- 4
- 5
- 6
- 17
资源评论
小小哭包
- 粉丝: 2050
- 资源: 4203
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 镜像资源包php7.4.33
- 基于LLM的命名实体识别(NER)和实体关系抽取(IE)
- 基于python和llm大模型开发的数据处理和任务调度系统
- JAVASpring mvc在线问卷答题系统源码数据库 MySQL源码类型 WebForm
- 作业1-视频1111111111111
- python-基于LLM multi agents的《谁是卧底》游戏模拟+项目源码+文档说明
- 实训做的STM32C8T6循迹小车, L298N,目前是实现了循迹功能,语音播报功能,蓝牙功能,原来代码是四轮的,改成两轮的了
- 744121054161446音悦时光_1.6.1.apk
- Matlab中常用的34种数据降维方法(数学建模)
- C#ASP.NET房屋所有权证书打印系统源码数据库 其他源码类型 WinForm
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功