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

📄 entityclassinfo.java

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

import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Map.Entry;

import net.sf.json.JSONArray;

import com.saas.biz.JavaScriptObject.CheckTreeObject;
import com.saas.biz.JavaScriptObject.TreeNode;
import com.saas.biz.commen.commMethodMgr;
import com.saas.biz.dao.classDAO.ClassDAO;
import com.saas.biz.dao.classDAO.ClassExt;
import com.saas.sys.buffer.Buffers;
import com.saas.sys.dbm.Dbtable;
import com.saas.sys.exp.SaasApplicationException;
import com.saas.sys.log.Logger;

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

		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 addClassInfo(Buffers inbuffer) {

		log.LOG_INFO("进入addClassInfo方法...");
		this.outBuffer = inbuffer;
		this.inBuffer = inbuffer;
		int iResult = -1;
		String cust_id = inbuffer.getString("SESSION_CUST_ID");
		String entity_type = inbuffer.getString("ENTITY_TYPE");
		String class_id = inbuffer.getString("CLASS_ID");
		String class_name = inbuffer.getString("CLASS_NAME");
		String up_class_id = inbuffer.getString("UP_CLASS_ID");
		String class_level = inbuffer.getString("CLASS_LEVEL");
		String one_tag = inbuffer.getString("ONE_TAG");
		String class_type = inbuffer.getString("CLASS_TYPE");
		String class_desc = inbuffer.getString("CLASS_DESC");
		String enable_tag = inbuffer.getString("ENABLE_TAG");
		String oper_user_id = inbuffer.getString("SESSION_USER_ID");
		String remark = inbuffer.getString("REMARK");
		try {
			ClassDAO classDao = new ClassDAO();
			classDao.setClass_desc(class_desc);
			classDao.setClass_id(class_id);
			classDao.setClass_level(class_level);
			classDao.setClass_name(class_name);
			classDao.setClass_type(class_type);
			classDao.setCust_id(cust_id);
			classDao.setEnable_tag(enable_tag);
			classDao.setEntity_type(entity_type);
			classDao.setUp_class_id(up_class_id);
			classDao.setOne_tag(one_tag);
			classDao.setRemark(remark);
			classDao.setOper_user_id(oper_user_id);
			iResult = addClassInfo(classDao);
		}
		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("退出addClassInfo方法...");
	}
	
	
	public int addClassInfo(ClassDAO classDao) {

		ClassExt classExt = new ClassExt();
		classExt.setParam(":VCLASS_DESC", classDao.getClass_desc());
		classExt.setParam(":VCLASS_ID", classDao.getClass_id());
		classExt.setParam(":VCLASS_LEVEL", classDao.getClass_level());
		classExt.setParam(":VCLASS_NAME", classDao.getClass_name());
		classExt.setParam(":VCLASS_TYPE", classDao.getClass_type());
		classExt.setParam(":VCUST_ID", classDao.getCust_id());
		classExt.setParam(":VENABLE_TAG", classDao.getEnable_tag());
		classExt.setParam(":VENTITY_TYPE", classDao.getEntity_type());
		classExt.setParam(":VUP_CLASS_ID", classDao.getUp_class_id());
		classExt.setParam(":VONE_TAG", classDao.getOne_tag());
		classExt.setParam(":VREMARK", classDao.getRemark());
		classExt.setParam(":VOPER_USER_ID", classDao.getOper_user_id());
		tradeQuery.executeBy(classExt.insBy("INS_BY_ALL"));
		return 0;
	}
	
	
	
	// 修改分类属性
	public void updateClassInfo(Buffers inbuffer) {

		log.LOG_INFO("进入updateClassInfo方法...");
		this.outBuffer = inbuffer;
		this.inBuffer = inbuffer;
		int iResult = -1;
		String cust_id = inbuffer.getString("SESSION_CUST_ID");
		String entity_type = inbuffer.getString("ENTITY_TYPE");
		String class_id = inbuffer.getString("CLASS_ID");
		String class_name = inbuffer.getString("CLASS_NAME");
		String up_class_id = inbuffer.getString("UP_CLASS_ID");
		String class_level = inbuffer.getString("CLASS_LEVEL");
		String one_tag = inbuffer.getString("ONE_TAG");
		String class_type = inbuffer.getString("CLASS_TYPE");
		String class_desc = inbuffer.getString("CLASS_DESC");
		String enable_tag = inbuffer.getString("ENABLE_TAG");
		String oper_user_id = inbuffer.getString("SESSION_USER_ID");
		String remark = inbuffer.getString("REMARK");
		try {
			ClassDAO classDao = new ClassDAO();
			classDao.setClass_desc(class_desc);
			classDao.setClass_id(class_id);
			classDao.setClass_level(class_level);
			classDao.setClass_name(class_name);
			classDao.setClass_type(class_type);
			classDao.setCust_id(cust_id);
			classDao.setEnable_tag(enable_tag);
			classDao.setEntity_type(entity_type);
			classDao.setUp_class_id(up_class_id);
			classDao.setOne_tag(one_tag);
			classDao.setRemark(remark);
			classDao.setOper_user_id(oper_user_id);
			iResult = updateClassInfo(classDao);
		}
		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("退出updateClassInfo方法...");
	}
	
	
	public int updateClassInfo(ClassDAO classDao) {

		ClassExt classExt = new ClassExt();
		classExt.setParam(":VCLASS_DESC", classDao.getClass_desc());
		classExt.setParam(":VCLASS_ID", classDao.getClass_id());
		classExt.setParam(":VCLASS_LEVEL", classDao.getClass_level());
		classExt.setParam(":VCLASS_NAME", classDao.getClass_name());
		classExt.setParam(":VCLASS_TYPE", classDao.getClass_type());
		classExt.setParam(":VCUST_ID", classDao.getCust_id());
		classExt.setParam(":VENABLE_TAG", classDao.getEnable_tag());
		classExt.setParam(":VENTITY_TYPE", classDao.getEntity_type());
		classExt.setParam(":VUP_CLASS_ID", classDao.getUp_class_id());
		classExt.setParam(":VONE_TAG", classDao.getOne_tag());
		classExt.setParam(":VREMARK", classDao.getRemark());
		classExt.setParam(":VOPER_USER_ID", classDao.getOper_user_id());
		tradeQuery.executeBy(classExt.insBy("UPDATE_BY_ALL"));
		return 0;
	}
	
	
	
	// 删除分类属性
	public void delClassInfo(Buffers inbuffer) {

		log.LOG_INFO("进入delClassInfo方法...");
		this.outBuffer = inbuffer;
		this.inBuffer = inbuffer;
		int iResult = -1;
		String class_id = inbuffer.getString("CLASS_ID");
		String cust_id = inbuffer.getString("SESSION_CUST_ID");
		try {
			ClassDAO classDao = new ClassDAO();
			classDao.setClass_id(class_id);
			classDao.setCust_id(cust_id);
			iResult = delClassInfo(classDao);
		}
		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("退出addClassInfo方法...");
	}
	
	
	public int delClassInfo(ClassDAO classDao) {

		ClassExt classExt = new ClassExt();
		classExt.setParam(":VCLASS_ID", classDao.getClass_id());
		classExt.setParam(":VCUST_ID", classDao.getCust_id());
		tradeQuery.executeBy(classExt.insBy("DEL_BY_ID"));
		return 0;
	}
	
	
	
	// 找出单个分类
	public ArrayList getClassInfoByClassId(String cust_id, String class_id) throws SaasApplicationException {

		ArrayList list = new ArrayList();
		ClassExt classExt = new ClassExt();
		classExt.setParam(":VCLASS_ID", class_id);
		classExt.setParam(":VCUST_ID", cust_id);
		list = classExt.selByList("SEL_BY_ID");
		return list;
	}
	
	
	public Map getClassInfoByIdx(String cust_id, String class_id) throws SaasApplicationException {

		ArrayList list = new ArrayList();
		Map<String, String> classMap = new HashMap<String, String>();
		list = getClassInfoByClassId(cust_id, class_id);
		String entity_type = "";
		String class_name = "";
		String one_tag = "";
		String class_type = "";
		String class_desc = "";
		String enable_tag = "";
		String remark = "";
		if (list != null && list.size() > 0) {
			HashMap map = (HashMap) list.get(0);
			entity_type = map.get("entity_type").toString();
			class_name = map.get("class_name").toString();
			one_tag = map.get("one_tag").toString();
			class_type = map.get("class_type").toString();
			class_desc = map.get("class_desc").toString();
			enable_tag = map.get("enable_tag").toString();
			remark = map.get("remark").toString();
		}
		classMap.put("entity_type", entity_type);
		classMap.put("class_name", class_name);
		classMap.put("one_tag", one_tag);
		classMap.put("class_type", class_type);
		classMap.put("class_desc", class_desc);
		classMap.put("enable_tag", enable_tag);
		classMap.put("remark", remark);
		return classMap;
	}
	
	
	
	// 找出归属于客户的分类
	public Map getClassInfoByUpClassId(String cust_id, String up_class_id) throws SaasApplicationException {

		ArrayList list = new ArrayList();
		Map<String, String> map = new LinkedHashMap<String, String>();
		ClassExt classExt = new ClassExt();
		classExt.setParam(":VUP_CLASS_ID", up_class_id);
		classExt.setParam(":VCUST_ID", cust_id);
		list = classExt.selByList("SEL_BY_UPID");
		if (list != null && list.size() > 0) {
			for (int i = 0; i < list.size(); i++) {
				HashMap classMap = (HashMap) list.get(i);
				String class_id = classMap.get("class_id").toString();

⌨️ 快捷键说明

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