📄 custinfo.java
字号:
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(":VGROUP_MEMO", customerDao.getGroup_memo());
customerExt.setParam(":VREG_MONEY", customerDao.getReg_money());
customerExt.setParam(":VCUST_ID", customerDao.getCust_id());
tradeQuery.executeBy(customerExt.insBy("INS_BY_ALL"));
this.outBuffer.setString("CUST_ID", customerDao.getCust_id());
this.outBuffer.setString("SPEC_ROOT_ID", customerDao.getCust_id());
return 0;
}
// 增加客户级别
public void addCustLevel(Buffers inbuffer) {
this.outBuffer = inbuffer;
this.inBuffer = inbuffer;
log.LOG_INFO("进入addCustLevel方法...");
int iResult = -1;
try {
CustLevelDAO custLevelDAO = new CustLevelDAO();
custLevelDAO.setCust_id(inbuffer.getString("cust_id"));
custLevelDAO.setCust_oper_person(inbuffer.getString("SESSION_CUST_ID"));
iResult = addCustLevel(custLevelDAO);
}
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("退出addCustLevel方法...");
}
public int addCustLevel(CustLevelDAO custLevelDAO) throws SaasApplicationException {
String start_date = new SimpleDateFormat("yyyyMMdd").format(new Date()).toString();
String end_date = "20500101";
CustLevelExt custLevelExt = new CustLevelExt();
custLevelExt.setParam(":VCUST_ID", custLevelDAO.getCust_id());
custLevelExt.setParam(":VCUST_CLASS", "1");
custLevelExt.setParam(":VCUST_OPER_PERSON", custLevelDAO.getCust_oper_person());
custLevelExt.setParam(":VCUST_START_DATE", start_date);
custLevelExt.setParam(":VCUST_OPER_DATE", start_date);
custLevelExt.setParam(":VCUST_END_DATE", end_date);
custLevelExt.setParam(":VCUST_DESC", "新用户");
tradeQuery.executeBy(custLevelExt.insBy("INS_BY_ALLCLASS"));
return 0;
}
// 查找全部客户资料
public void genCustInfo(Buffers inbuffer) {
log.LOG_INFO("进入genCustInfo方法...");
try {
this.queryResult = genCustInfo();
}
catch (SaasApplicationException e) {
log.LOG_INFO(e.getMessage());
}
log.LOG_INFO("退出genCustInfo方法...");
}
public ArrayList genCustInfo() throws SaasApplicationException {
commMethodMgr comm = new commMethodMgr();
ArrayList customerList = new ArrayList();
ArrayList customerListID = new ArrayList();
ArrayList itemsList = new ArrayList();
ArrayList itemsList1 = new ArrayList();
ArrayList itemsList2 = new ArrayList();
CustomerExt customerExt = new CustomerExt();
CustomerExt customerExtID = new CustomerExt();
customerList = customerExt.selByList("SEL_BY_ALL");
if (customerList == null)
return null;
String custstate = "3";
customerExtID.setParam(":VCUST_STATE", custstate);
customerListID = customerExtID.selByList("SEL_SPEC_CUST_STATE");
if (customerListID == null)
return null;
for (Iterator it = customerList.iterator(); it.hasNext();) {
HashMap customerListMap = (HashMap) it.next();
String custName = "";
String custId = "";
String scope = "";
String cust_state = "";
HashMap customerMap = new HashMap();
if (customerListMap.get("cust_id") != null)
custId = customerListMap.get("cust_id").toString();
if (customerListMap.get("cust_name") != null)
custName = customerListMap.get("cust_name").toString();
if (customerListMap.get("scope") != null)
scope = customerListMap.get("scope").toString();
scope = comm.splitStr(scope, 117);
if (customerListMap.get("cust_state") != null)
cust_state = customerListMap.get("cust_state").toString();
customerMap.put("cust_name", custName);
customerMap.put("cust_id", custId);
customerMap.put("scope", scope);
itemsList1.add(customerMap);
}
for (Iterator its = customerListID.iterator(); its.hasNext();) {
HashMap customerListIDMap = (HashMap) its.next();
String custName_state = "";
String custId_state = "";
String scope_state = "";
HashMap customerIDMap = new HashMap();
if (customerListIDMap.get("cust_id") != null)
custId_state = customerListIDMap.get("cust_id").toString();
if (customerListIDMap.get("cust_name") != null)
custName_state = customerListIDMap.get("cust_name").toString();
if (customerListIDMap.get("scope") != null)
scope_state = customerListIDMap.get("scope").toString();
scope_state = comm.splitStr(scope_state, 117);
customerIDMap.put("custName_state", custName_state);
customerIDMap.put("cust_id", custId_state);
customerIDMap.put("scope_state", scope_state);
itemsList2.add(customerIDMap);
}
itemsList.add(0, itemsList1);
itemsList.add(1, itemsList2);
return itemsList;
}
// 查找指定的客户资料
public void genSpecCustInfo(Buffers inbuffer) {
log.LOG_INFO("进入genSpecCustInfo方法...");
this.outBuffer = inbuffer;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -