⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 entclassinfo.java

📁 java阿里巴巴代码
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
package com.saas.biz.entClassMgr;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.saas.biz.commen.commMethodMgr;
import com.saas.biz.dao.entClassDAO.EntClassDAO;
import com.saas.biz.dao.entClassDAO.EntClassExt;
import com.saas.biz.dao.groupDAO.GroupInfoExt;
import com.saas.biz.entityclassMgr.EntityClassInfo;
import com.saas.sys.buffer.Buffers;
import com.saas.sys.dbm.Dbtable;
import com.saas.sys.exp.SaasApplicationException;
import com.saas.sys.log.Logger;
import java.util.StringTokenizer;
import java.util.Map.Entry;

public class EntClassInfo {
	
	
	Dbtable tradeQuery;
	
	
	commMethodMgr comm;
	
	
	Logger log;
	
	
	Buffers inBuffer;
	
	
	Buffers outBuffer;
	
	
	ArrayList queryResult = new ArrayList();
	
	
	
	public EntClassInfo() {

		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;
	}
	
	
	
	// 实体
	public void addEntClassInfo(Buffers inbuffer) {

		log.LOG_INFO("进入addEntClassInfo方法...");
		this.outBuffer = inbuffer;
		this.inBuffer = inbuffer;
		int iResult = -1;
		String cust_id = inbuffer.getString("SESSION_CUST_ID");
		String entity_id = inbuffer.getString("CUST_ID");
		String entity_type = inbuffer.getString("ENTITY_TYPE");
		String class_id = inbuffer.getString("E_CLASS_ID");
		String class_name = inbuffer.getString("E_CLASS_NAME");
		String class_id_grp = inbuffer.getString("E_CLASS_ID_GRP");
		String class_name_grp = inbuffer.getString("E_CLASS_NAME_GRP");
		String oper_user_id = inbuffer.getString("SESSION_USER_ID");
		EntClassDAO entDao = new EntClassDAO();
		try {
			entDao.setClass_id(class_id);
			entDao.setClass_id_grp(class_id_grp);
			entDao.setClass_name(class_name);
			entDao.setClass_name_grp(class_name_grp);
			entDao.setCust_id(cust_id);
			entDao.setEntity_type(entity_type);
			entDao.setEntity_id(entity_id);
			entDao.setOper_user_id(oper_user_id);
			iResult = addEntClassInfo(entDao);
		}
		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("退出addEntClassInfo方法...");
	}
	
	
	public int addEntClassInfo(EntClassDAO entDao) throws SaasApplicationException {

		EntClassExt entExt = new EntClassExt();
		entExt.setParam(":VCLASS_ID", entDao.getClass_id());
		entExt.setParam(":VCLASS_ID_GRP", entDao.getClass_id_grp());
		entExt.setParam(":VCLASS_NAME", entDao.getClass_name());
		entExt.setParam(":VCLASS_NAME_GRP", entDao.getClass_name_grp());
		entExt.setParam(":VCUST_ID", entDao.getCust_id());
		entExt.setParam(":VENTITY_TYPE", entDao.getEntity_type());
		entExt.setParam(":VENTITY_ID", entDao.getEntity_id());
		entExt.setParam(":VOPER_USER_ID", entDao.getOper_user_id());
		tradeQuery.executeBy(entExt.insBy("INS_BY_ALL"));
		return 0;
	}
	
	
	
	// 新增实体级别
	public void addEntClassRank(Buffers inbuffer) {

		log.LOG_INFO("进入addEntClassRank方法...");
		this.outBuffer = inbuffer;
		this.inBuffer = inbuffer;
		int iResult = -1;
		String cust_id = inbuffer.getString("SESSION_CUST_ID");
		String entity_id = inbuffer.getString("CUST_ID");
		String entity_type = inbuffer.getString("ENTITY_TYPE");
		String class_id = inbuffer.getString("RELA_CLASS");
		String class_name = "";
		String class_id_grp = "";
		String class_name_grp = "";
		String oper_user_id = inbuffer.getString("SESSION_USER_ID");
		EntClassDAO entDao = new EntClassDAO();
		try {
			
			Map map = getGroupClassById(cust_id, class_id, entity_type);
			if (map != null && map.size() > 0) {
				Entry ent = (Entry) map.entrySet().iterator().next();
				class_id_grp = String.valueOf(ent.getKey());
				class_name_grp = String.valueOf(ent.getValue());
			}
			entDao.setClass_id(class_id);
			entDao.setClass_id_grp(class_id_grp);
			entDao.setClass_name(class_name);
			entDao.setClass_name_grp(class_name_grp);
			entDao.setCust_id(cust_id);
			entDao.setEntity_type(entity_type);
			entDao.setEntity_id(entity_id);
			entDao.setOper_user_id(oper_user_id);
			iResult = addEntClassRank(entDao);
		}
		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("退出addEntClassRank方法...");
	}
	
	
	public int addEntClassRank(EntClassDAO entDao) throws SaasApplicationException {

		EntClassExt entExt = new EntClassExt();
		entExt.setParam(":VCLASS_ID", entDao.getClass_id());
		entExt.setParam(":VCLASS_ID_GRP", entDao.getClass_id_grp());
		entExt.setParam(":VCLASS_NAME", entDao.getClass_name());
		entExt.setParam(":VCLASS_NAME_GRP", entDao.getClass_name_grp());
		entExt.setParam(":VCUST_ID", entDao.getCust_id());
		entExt.setParam(":VENTITY_TYPE", entDao.getEntity_type());
		entExt.setParam(":VENTITY_ID", entDao.getEntity_id());
		entExt.setParam(":VOPER_USER_ID", entDao.getOper_user_id());
		tradeQuery.executeBy(entExt.insBy("INS_BY_ALL"));
		return 0;
	}
	
	
	
	// 新加级别
	public void addEntClassRankOpp(Buffers inbuffer) {

		log.LOG_INFO("进入addEntClassRankOpp方法...");
		this.outBuffer = inbuffer;
		this.inBuffer = inbuffer;
		int iResult = -1;
		String cust_id = inbuffer.getString("SESSION_CUST_ID");
		String entity_id = inbuffer.getString("USER_ID");
		String entity_type = "2";
		String class_id = inbuffer.getString("RELA_CLASS");
		String class_name = "";
		String class_id_grp = "";
		String class_name_grp = "";
		String oper_user_id = inbuffer.getString("SESSION_USER_ID");
		EntClassDAO entDao = new EntClassDAO();
		try {
			
			Map map = getGroupClassById(cust_id, class_id, entity_type);
			if (map != null && map.size() > 0) {
				Entry ent = (Entry) map.entrySet().iterator().next();
				class_id_grp = String.valueOf(ent.getKey());
				class_name_grp = String.valueOf(ent.getValue());
			}
			entDao.setClass_id(class_id);
			entDao.setClass_id_grp(class_id_grp);
			entDao.setClass_name(class_name);
			entDao.setClass_name_grp(class_name_grp);
			entDao.setCust_id(cust_id);
			entDao.setEntity_type(entity_type);
			entDao.setEntity_id(entity_id);
			entDao.setOper_user_id(oper_user_id);
			iResult = addEntClassRankOpp(entDao);
		}
		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("退出addEntClassRankOpp方法...");
	}
	
	
	
	/**
	 * 添加分类信息
	 * 
	 * @LiuYang
	 * @修改分类[排斥]
	 */
	public void addEntClassInfoByClass(Buffers inbuffer) {

		log.LOG_INFO("进入addEntClassInfoByClass方法...");
		this.outBuffer = inbuffer;
		this.inBuffer = inbuffer;
		int iResult = -1;
		String cust_id = inbuffer.getString("SESSION_CUST_ID");
		String own_id = inbuffer.getString("SESSION_USER_ID");
		String entity_type = inbuffer.getString("GROUP_TYPE");
		String class_id = inbuffer.getString("CLASS_ID");
		String user_id = inbuffer.getString("USER_ID");
		String class_name = inbuffer.getString("CLASS_NAME");
		String class_id_grp = "";
		String class_name_grp = "";
		EntClassDAO entDao = new EntClassDAO();
		try {
			
			Map map = getGroupClassById(cust_id, class_id, entity_type);
			if (map != null && map.size() > 0) {
				Entry ent = (Entry) map.entrySet().iterator().next();
				class_id_grp = String.valueOf(ent.getKey());
				class_name_grp = String.valueOf(ent.getValue());
			}
			entDao.setClass_id(class_id);
			entDao.setClass_id_grp(class_id_grp);
			entDao.setClass_name(class_name);
			entDao.setClass_name_grp(class_name_grp);
			entDao.setCust_id(cust_id);
			entDao.setEntity_type(entity_type);
			entDao.setEntity_id(user_id);
			entDao.setOper_user_id(own_id);
			iResult = addEntClassRankOpp(entDao);
		}
		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("退出addEntClassRankOpp方法...");
	}
	
	
	public int addEntClassRankOpp(EntClassDAO entDao) throws SaasApplicationException {

		String idx = entDao.getEntity_id();
		StringTokenizer st = new StringTokenizer(idx, "|");
		while (st.hasMoreTokens()) {
			String id = st.nextToken();
			EntClassExt entExt = new EntClassExt();
			entExt.setParam(":VCLASS_ID", entDao.getClass_id());
			entExt.setParam(":VCLASS_ID_GRP", entDao.getClass_id_grp());
			entExt.setParam(":VCLASS_NAME", entDao.getClass_name());
			entExt.setParam(":VCLASS_NAME_GRP", entDao.getClass_name_grp());
			entExt.setParam(":VCUST_ID", entDao.getCust_id());
			entExt.setParam(":VENTITY_TYPE", entDao.getEntity_type());
			entExt.setParam(":VENTITY_ID", id);
			entExt.setParam(":VOPER_USER_ID", entDao.getOper_user_id());
			tradeQuery.executeBy(entExt.insBy("UPDATE_BY_ALL"));
		}
		return 0;
	}
	
	
	
	/**
	 * 没有用到:updateEntClassRankOpp
	 * 
	 * @param inbuffer
	 */
	public void updateEntClassRankOpp(Buffers inbuffer) {

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -