📄 customerdefinitioninfo.java
字号:
package com.saas.biz.custDefinitionMgr;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import com.saas.biz.commen.commMethodMgr;
import com.saas.biz.dao.custDefinitionDAO.CustDefinitionDAO;
import com.saas.biz.dao.custDefinitionDAO.CustDefinitionExt;
import com.saas.sys.buffer.Buffers;
import com.saas.sys.dbm.Dbtable;
import com.saas.sys.exp.SaasApplicationException;
import com.saas.sys.log.Logger;
/**
* @author:LiuYang
* @desc:客户定制参数
* @2008-5-26
*/
public class CustomerDefinitionInfo implements Serializable {
private static final long serialVersionUID = 1072594656114902775L;
Dbtable tradeQuery;
commMethodMgr comm;
Logger log;
Buffers inBuffer;
Buffers outBuffer;
ArrayList queryResult = new ArrayList();
public CustomerDefinitionInfo() {
log = new Logger(this);
tradeQuery = new Dbtable();
comm = new commMethodMgr();
}
public void setTradeQuery(Dbtable tradeQuery) {
this.tradeQuery = tradeQuery;
}
public Dbtable getTradeQuery() {
return this.tradeQuery;
}
public void setOutBuffer(Buffers outBuffer) {
this.outBuffer = outBuffer;
}
public Buffers getOutBuffer() {
return this.outBuffer;
}
public ArrayList getQueryResult() {
return this.queryResult;
}
public void setQueryResult(ArrayList queryResult) {
this.queryResult = queryResult;
}
/**
* 增加客户服务订制
*
* @param inbuffer
*/
public void addCustomerParameter(Buffers inbuffer) {
log.LOG_INFO("进入addCustomerParameter方法...");
this.outBuffer = inbuffer;
this.inBuffer = inbuffer;
int iResult = -1;
String cust_id = inbuffer.getString("SESSION_CUST_ID");
String subsys_code = inbuffer.getString("SUBSYS_CODE");
String depart_group = inbuffer.getString("DEPART_GROUP");
String role_group = inbuffer.getString("ROLE_GROUP");
String leve_group = inbuffer.getString("LEVE_GROUP");
String type_group = inbuffer.getString("TYPE_GROUP");
String para_code1 = inbuffer.getString("PARA_CODE1");
String para_code2 = inbuffer.getString("PARA_CODE2");
String para_code3 = inbuffer.getString("PARA_CODE3");
String para_code4 = inbuffer.getString("PARA_CODE4");
String para_code5 = inbuffer.getString("PARA_CODE5");
String para_code6 = inbuffer.getString("PARA_CODE6");
String para_code7 = inbuffer.getString("PARA_CODE7");
String para_code8 = inbuffer.getString("PARA_CODE8");
String para_code9 = inbuffer.getString("PARA_CODE9");
String para_code10 = inbuffer.getString("PARA_CODE10");
String start_date = inbuffer.getString("START_DATE");
String end_date = inbuffer.getString("END_DATE");
String remark = inbuffer.getString("REMARK");
String oper_user_id = inbuffer.getString("SESSION_USER_ID");
try {
CustDefinitionDAO sysDao = new CustDefinitionDAO();
sysDao.setCust_id(cust_id);
sysDao.setSubsys_code(subsys_code);
sysDao.setDepart_group(depart_group);
sysDao.setRole_group(role_group);
sysDao.setLeve_group(leve_group);
sysDao.setType_group(type_group);
sysDao.setPara_code1(para_code1);
sysDao.setPara_code2(para_code2);
sysDao.setPara_code3(para_code3);
sysDao.setPara_code4(para_code4);
sysDao.setPara_code5(para_code5);
sysDao.setPara_code6(para_code6);
sysDao.setPara_code7(para_code7);
sysDao.setPara_code8(para_code8);
sysDao.setPara_code9(para_code9);
sysDao.setPara_code10(para_code10);
sysDao.setStart_date(start_date);
sysDao.setEnd_date(end_date);
sysDao.setRemark(remark);
sysDao.setOper_user_id(oper_user_id);
ArrayList list = checkCustomerDefinition(cust_id, subsys_code);
if (list != null && list.size() > 0) {
HashMap map = (HashMap) list.get(0);
String id = "";
if (map.get("id") != null) {
id = map.get("id").toString();
sysDao.setId(id);
iResult = editCustomerParameter(sysDao);
}
}
else {
iResult = addCustomerParameter(sysDao);
}
}
catch (Exception 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("退出addCustomerParameter方法...");
}
public int addCustomerParameter(CustDefinitionDAO sysDao) throws SaasApplicationException {
CustDefinitionExt custExt = new CustDefinitionExt();
custExt.setParam(":VCUST_ID", sysDao.getCust_id());
custExt.setParam(":VSUBSYS_CODE", sysDao.getSubsys_code());
custExt.setParam(":VDEPART_GROUP", sysDao.getDepart_group());
custExt.setParam(":VROLE_GROUP", sysDao.getRole_group());
custExt.setParam(":VLEVE_GROUP", sysDao.getLeve_group());
custExt.setParam(":VTYPE_GROUP", sysDao.getType_group());
custExt.setParam(":VPARA_CODE1", sysDao.getPara_code1());
custExt.setParam(":VPARA_CODE2", sysDao.getPara_code2());
custExt.setParam(":VPARA_CODE3", sysDao.getPara_code3());
custExt.setParam(":VPARA_CODE4", sysDao.getPara_code4());
custExt.setParam(":VPARA_CODE5", sysDao.getPara_code5());
custExt.setParam(":VPARA_CODE6", sysDao.getPara_code6());
custExt.setParam(":VPARA_CODE7", sysDao.getPara_code7());
custExt.setParam(":VPARA_CODE8", sysDao.getPara_code8());
custExt.setParam(":VPARA_CODE9", sysDao.getPara_code9());
custExt.setParam(":VPARA_CODE10", sysDao.getPara_code10());
custExt.setParam(":VSTART_DATE", sysDao.getStart_date());
custExt.setParam(":VEND_DATE", sysDao.getEnd_date());
custExt.setParam(":VREMARK", sysDao.getRemark());
custExt.setParam(":VOPER_USER_ID", sysDao.getOper_user_id());
tradeQuery.executeBy(custExt.insBy("INS_BY_ALL"));
return 0;
}
// 修改客户定制
public void editCustomerParameter(Buffers inbuffer) {
log.LOG_INFO("进入editCustomerParameter方法...");
this.outBuffer = inbuffer;
this.inBuffer = inbuffer;
int iResult = -1;
String id = inbuffer.getString("ID");
String cust_id = inbuffer.getString("SESSION_CUST_ID");
String subsys_code = inbuffer.getString("SUBSYS_CODE");
String depart_group = inbuffer.getString("DEPART_GROUP");
String role_group = inbuffer.getString("ROLE_GROUP");
String leve_group = inbuffer.getString("LEVE_GROUP");
String type_group = inbuffer.getString("TYPE_GROUP");
String para_code1 = inbuffer.getString("PARA_CODE1");
String para_code2 = inbuffer.getString("PARA_CODE2");
String para_code3 = inbuffer.getString("PARA_CODE3");
String para_code4 = inbuffer.getString("PARA_CODE4");
String para_code5 = inbuffer.getString("PARA_CODE5");
String para_code6 = inbuffer.getString("PARA_CODE6");
String para_code7 = inbuffer.getString("PARA_CODE7");
String para_code8 = inbuffer.getString("PARA_CODE8");
String para_code9 = inbuffer.getString("PARA_CODE9");
String para_code10 = inbuffer.getString("PARA_CODE10");
String start_date = inbuffer.getString("START_DATE");
String end_date = inbuffer.getString("END_DATE");
String remark = inbuffer.getString("REMARK");
String oper_user_id = inbuffer.getString("SESSION_USER_ID");
try {
CustDefinitionDAO sysDao = new CustDefinitionDAO();
sysDao.setId(id);
sysDao.setCust_id(cust_id);
sysDao.setSubsys_code(subsys_code);
sysDao.setDepart_group(depart_group);
sysDao.setRole_group(role_group);
sysDao.setLeve_group(leve_group);
sysDao.setType_group(type_group);
sysDao.setPara_code1(para_code1);
sysDao.setPara_code2(para_code2);
sysDao.setPara_code3(para_code3);
sysDao.setPara_code4(para_code4);
sysDao.setPara_code5(para_code5);
sysDao.setPara_code6(para_code6);
sysDao.setPara_code7(para_code7);
sysDao.setPara_code8(para_code8);
sysDao.setPara_code9(para_code9);
sysDao.setPara_code10(para_code10);
sysDao.setStart_date(start_date);
sysDao.setEnd_date(end_date);
sysDao.setRemark(remark);
sysDao.setOper_user_id(oper_user_id);
iResult = editCustomerParameter(sysDao);
}
catch (Exception 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("退出editCustomerParameter方法...");
}
public int editCustomerParameter(CustDefinitionDAO sysDao) throws SaasApplicationException {
CustDefinitionExt custExt = new CustDefinitionExt();
custExt.setParam(":VID", sysDao.getId());
custExt.setParam(":VCUST_ID", sysDao.getCust_id());
custExt.setParam(":VSUBSYS_CODE", sysDao.getSubsys_code());
custExt.setParam(":VDEPART_GROUP", sysDao.getDepart_group());
custExt.setParam(":VROLE_GROUP", sysDao.getRole_group());
custExt.setParam(":VLEVE_GROUP", sysDao.getLeve_group());
custExt.setParam(":VTYPE_GROUP", sysDao.getType_group());
custExt.setParam(":VPARA_CODE1", sysDao.getPara_code1());
custExt.setParam(":VPARA_CODE2", sysDao.getPara_code2());
custExt.setParam(":VPARA_CODE3", sysDao.getPara_code3());
custExt.setParam(":VPARA_CODE4", sysDao.getPara_code4());
custExt.setParam(":VPARA_CODE5", sysDao.getPara_code5());
custExt.setParam(":VPARA_CODE6", sysDao.getPara_code6());
custExt.setParam(":VPARA_CODE7", sysDao.getPara_code7());
custExt.setParam(":VPARA_CODE8", sysDao.getPara_code8());
custExt.setParam(":VPARA_CODE9", sysDao.getPara_code9());
custExt.setParam(":VPARA_CODE10", sysDao.getPara_code10());
custExt.setParam(":VSTART_DATE", sysDao.getStart_date());
custExt.setParam(":VEND_DATE", sysDao.getEnd_date());
custExt.setParam(":VREMARK", sysDao.getRemark());
custExt.setParam(":VOPER_USER_ID", sysDao.getOper_user_id());
tradeQuery.executeBy(custExt.insBy("EDIT_BY_ALL"));
return 0;
}
// 删除客户定制
public void delCustomerParameter(Buffers inbuffer) {
log.LOG_INFO("进入delCustomerParameter方法...");
this.outBuffer = inbuffer;
this.inBuffer = inbuffer;
int iResult = -1;
String cust_id = inbuffer.getString("SESSION_CUST_ID");
String id = inbuffer.getString("ID");
try {
iResult = delCustomerParameter(cust_id, id);
}
catch (Exception 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("退出delCustomerParameter方法...");
}
public int delCustomerParameter(String cust_id, String id) throws SaasApplicationException {
CustDefinitionExt custExt = new CustDefinitionExt();
custExt.setParam(":VCUST_ID", cust_id);
custExt.setParam(":VID", id);
tradeQuery.executeBy(custExt.insBy("DEL_BY_ID"));
return 0;
}
// 取出客户定制信息
public ArrayList getCustomerDefinitionByCust(String cust_id) throws SaasApplicationException {
CustDefinitionExt custExt = new CustDefinitionExt();
custExt.setParam(":VCUST_ID", cust_id);
ArrayList list = custExt.selByList("SEL_BY_CUST");
return list;
}
// 取出单条信息
public ArrayList getCustomerDefinitionById(String id) throws SaasApplicationException {
CustDefinitionExt custExt = new CustDefinitionExt();
custExt.setParam(":VID", id);
ArrayList list = custExt.selByList("SEL_BY_ID");
return list;
}
// 取出单条信息
public ArrayList checkCustomerDefinition(String cust_id, String sys_code) throws SaasApplicationException {
CustDefinitionExt custExt = new CustDefinitionExt();
custExt.setParam(":VCUST_ID", cust_id);
custExt.setParam(":VSUBSYS_CODE", sys_code);
ArrayList list = custExt.selByList("SEL_BY_SYSCODE");
return list;
}
// 判断订单的审批机制
@SuppressWarnings("unchecked")
public HashMap getAuditMap(String cust_id) throws SaasApplicationException {
HashMap map = new HashMap();
String order_code = "";
String depart_code = "";
String role_code = "";
String level_code = "";
String type_code = "";
ArrayList list = getCustomerDefinitionByCust(cust_id);
if (list != null && list.size() > 0) {
for (int i = 0; i < list.size(); i++) {
HashMap auditMap = (HashMap) list.get(i);
String code = "";
String depart = "";
String role = "";
String level = "";
String type = "";
if (auditMap.get("subsys_code") != null) {
code = auditMap.get("subsys_code").toString();
}
if (auditMap.get("depart_group") != null) {
depart = auditMap.get("depart_group").toString();
}
if (auditMap.get("role_group") != null) {
role = auditMap.get("role_group").toString();
}
if (auditMap.get("leve_group") != null) {
level = auditMap.get("leve_group").toString();
}
if (auditMap.get("type_group") != null) {
type = auditMap.get("type_group").toString();
}
order_code = order_code + code + "|";
depart_code = depart_code + depart + "|";
role_code = role_code + role + "|";
level_code = level_code + level + "|";
type_code = type_code + type + "|";
}
}
map.put("order_code", order_code);
return map;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -