package com.saas.biz.custMgr;
import java.util.*;
import java.text.SimpleDateFormat;
import com.saas.biz.commen.commMethodMgr;
import com.saas.biz.dao.JobDAO.JobExt;
import com.saas.biz.dao.custDAO.CustomerDAO;
import com.saas.biz.dao.custDAO.CustomerExt;
import com.saas.biz.dao.examDAO.ParaexamExt;
import com.saas.biz.dao.custDAO.*;
import com.saas.sys.buffer.Buffers;
import com.saas.sys.dbm.Dbtable;
import com.saas.biz.attachMgr.*;
import com.saas.sys.exp.SaasApplicationException;
import com.saas.sys.log.Logger;
import com.saas.biz.dao.parallDAO.BidExt;
import com.saas.biz.dao.parallDAO.EnterPriseExt;
import com.saas.biz.dao.parallDAO.ProduceExt;
import com.saas.biz.dao.parallDAO.SaleInfoExt;
import com.saas.biz.dao.parallDAO.StockOrderExt;
import com.saas.biz.dao.parallDAO.StoreExt;
import com.saas.biz.dao.prcreditDAO.*;
import com.saas.biz.dao.newsDAO.*;
import com.saas.biz.dao.repositoryDAO.*;
import com.saas.biz.dao.userDAO.UserExt;
import com.saas.biz.userMgr.UserInfo;
public class Custinfo {
Logger log;
Buffers inBuffer;
Buffers outBuffer;
Dbtable tradeQuery;
commMethodMgr commen;
ArrayList queryResult = new ArrayList();
public Custinfo() {
log = new Logger(this);
tradeQuery = new Dbtable();
commen = new commMethodMgr();
outBuffer = new Buffers();
}
public void setOutBuffer(Buffers outBuffer) {
this.outBuffer = outBuffer;
}
public Buffers getOutBuffer() {
return this.outBuffer;
}
public void setTradeQuery(Dbtable tradeQuery) {
this.tradeQuery = tradeQuery;
}
public Dbtable getTradeQuery() {
return this.tradeQuery;
}
public ArrayList getQueryResult() {
return this.queryResult;
}
public void setQueryResult(ArrayList queryResult) {
this.queryResult = queryResult;
}
// 增加客户信息
public void addCustinfo(Buffers inbuffer) {
this.outBuffer = inbuffer;
this.inBuffer = inbuffer;
log.LOG_INFO("进入addcustinfo方法...");
int iResult = -1;
try {
CustomerDAO customerDao = new CustomerDAO();
customerDao.setAll_emp_count(inbuffer.getString("ALL_EMP_COUNT"));// 全球员工数
customerDao.setCalling_area_code(inbuffer.getString("CALLING_AREA_CODE"));// 所属行业区域
// customerDao.setCalling_type_code(inbuffer.getString("CALLING_TYPE_CODE"));//
// 行业类别
customerDao.setChina_emp_count(inbuffer.getString("CHINA_EMP_COUNT"));// 中国员工数
customerDao.setCity(inbuffer.getString("CITY"));// 城市
// customerDao.setCity_code(inbuffer.getString("CITY_CODE"));//
// 归属业务区
customerDao.setClass_id(inbuffer.getString("CLASS_ID"));// 客户规模
customerDao.setClient_status(inbuffer.getString("CLIENT_STATUS"));// 集团状态
customerDao.setCompany_address(inbuffer.getString("COMPANY_ADDRESS"));// 公司地址
customerDao.setCust_name(inbuffer.getString("CUST_NAME"));// 客户名称
customerDao.setDevelope_channel(inbuffer.getString("DEVELOPE_CHANNEL"));// 发展渠道
customerDao.setDevelope_man(inbuffer.getString("DEVELOPE_MAN"));// 发展人
customerDao.setEmail(inbuffer.getString("EMAIL"));// 公司Email
customerDao.setEnterprise_scope(inbuffer.getString("ENTERPRISE_SCOPE"));// 区域特点
customerDao.setEnterprise_type_code(inbuffer.getString("ENTERPRISE_TYPE_CODE"));// 企业类型
// customerDao.setEparchy_code(inbuffer.getString("EPARCHY_CODE"));//
// 归属城市
customerDao.setFax_nbr(inbuffer.getString("FAX_NBR"));// 传真
customerDao.setGroup_attr(inbuffer.getString("GROUP_ATTR"));// 集团属性
customerDao.setGroup_contact_phone(inbuffer.getString("GROUP_CONTACT_PHONE"));// 联系电话
customerDao.setJuristic(inbuffer.getString("JURISTIC"));// 法人代表
customerDao.setJuristic_type_code(inbuffer.getString("JURISTIC_TYPE_CODE"));// 法人类别
customerDao.setLocal_emp_count(inbuffer.getString("LOCAL_EMP_COUNT"));// 本地员工数
customerDao.setPost_code(inbuffer.getString("POST_CODE"));// 邮政编码
customerDao.setPspt_addr(inbuffer.getString("PSPT_ADDR"));// 证件地址
customerDao.setPspt_id(inbuffer.getString("PSPT_ID"));// 证件号码
customerDao.setPspt_type_code(inbuffer.getString("PSPT_TYPE_CODE"));// 证件类型
customerDao.setUser_count(inbuffer.getString("USER_COUNT"));// 用户数
customerDao.setWebsite(inbuffer.getString("WEBSITE"));// 公司网站
customerDao.setEnterprise_size_code(inbuffer.getString("ENTERPRISE_SIZE_CODE"));// 企业规模
customerDao.setProvince(inbuffer.getString("PROVINCE"));// 省份
customerDao.setCust_aim(inbuffer.getString("CUST_AIM"));
customerDao.setGroup_memo(inbuffer.getString("GROUP_MEMO"));
customerDao.setScope(inbuffer.getString("SCOPE"));
customerDao.setReg_money(inbuffer.getString("REG_MONEY"));
customerDao.setCust_id(inbuffer.getString("CUST_ID"));
iResult = addCustinfo(customerDao);
}
catch (SaasApplicationException e) {
log.LOG_INFO(e.getMessage());
}
if (iResult != 0) {
this.outBuffer.setInt("RESULT_CODE", -1);
this.outBuffer.setString("RESULT_INFO", "新增客户业务处理失败!");
}
else {
this.outBuffer.setInt("RESULT_CODE", 0);
this.outBuffer.setString("RESULT_INFO", "新增客户业务处理成功!");
}
log.LOG_INFO("退出addcustinfo方法...");
}
public int addCustinfo(CustomerDAO customerDao) throws SaasApplicationException {
commMethodMgr comm = new commMethodMgr();
String genaccount_id = comm.GenTradeId();
String genjuristic_cust_id = comm.GenTradeId();
CustomerExt customerExt = new CustomerExt();
customerExt.setParam(":VALL_EMP_COUNT", customerDao.getAll_emp_count());
customerExt.setParam(":VCALLING_AREA_CODE", customerDao.getCalling_area_code());
customerExt.setParam(":VCALLING_TYPE_CODE", "");
customerExt.setParam(":VCHINA_EMP_COUNT", customerDao.getChina_emp_count());
customerExt.setParam(":VCITY", customerDao.getCity());
customerExt.setParam(":VCITY_CODE", "");
customerExt.setParam(":VCLASS_ID", customerDao.getClass_id());
customerExt.setParam(":VCLIENT_STATUS", "");
customerExt.setParam(":VCOMPANY_ADDRESS", customerDao.getCompany_address());
customerExt.setParam(":VCUST_NAME", customerDao.getCust_name());
customerExt.setParam(":VDEVELOPE_CHANNEL", customerDao.getDevelope_channel());
customerExt.setParam(":VDEVELOPE_MAN", customerDao.getDevelope_man());
customerExt.setParam(":VEMAIL", customerDao.getEmail());
customerExt.setParam(":VPROVINCE", customerDao.getProvince());
customerExt.setParam(":VENTERPRISE_TYPE_CODE", customerDao.getEnterprise_type_code());
customerExt.setParam(":VENTERPRISE_SCOPE", customerDao.getEnterprise_scope());
customerExt.setParam(":VENTERPRISE_SIZE_CODE", customerDao.getEnterprise_size_code());
customerExt.setParam(":VEPARCHY_CODE", "");
customerExt.setParam(":VFAX_NBR", customerDao.getFax_nbr());
customerExt.setParam(":VGROUP_ATTR", customerDao.getGroup_attr());
customerExt.setParam(":VGROUP_CONTACT_PHONE", customerDao.getGroup_contact_phone());
customerExt.setParam(":VJURISTIC", customerDao.getJuristic());
customerExt.setParam(":VJURISTIC_TYPE_CODE", customerDao.getJuristic_type_code());
customerExt.setParam(":VLOCAL_EMP_COUNT", customerDao.getLocal_emp_count());
customerExt.setParam(":VPOST_CODE", customerDao.getPost_code());
customerExt.setParam(":VPSPT_ADDR", customerDao.getPspt_addr());
customerExt.setParam(":VPSPT_ID", customerDao.getPspt_id());
customerExt.setParam(":VPSPT_TYPE_CODE", customerDao.getPspt_type_code());
customerExt.setParam(":VUSER_COUNT", customerDao.getUser_count());
customerExt.setParam(":VWEBSITE", customerDao.getWebsite());
customerExt.setParam(":VJURISTIC_CUST_ID", genjuristic_cust_id);
/*
* modify by sjp 2007-06-12
*/
customerExt.setParam(":VCUST_AIM", customerDao.getCust_aim());
customerExt.setParam(":VSCOPE", customerDao.getScope());
customerExt.setParam(":VGR