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

📄 processinfo.java

📁 java阿里巴巴代码
💻 JAVA
字号:
package com.saas.biz.ProcessMgr;

import java.util.ArrayList;
import java.util.*;
import com.saas.biz.commen.commMethodMgr;
import com.saas.biz.dao.ProcessDAO.ProcessDAO;
import com.saas.biz.dao.ProcessDAO.ProcessExt;
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 com.saas.biz.attachMgr.Attachinfo;

import com.saas.biz.dao.votesubjectDAO.VotesubjectExt;

public class ProcessInfo {
	Dbtable tradeQuery;

	commMethodMgr comm;

	Logger log;

	Buffers inBuffer;

	Buffers outBuffer;

	ArrayList queryResult = new ArrayList();

	public ProcessInfo() {

		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 addProcessInfo(Buffers inbuffer) {
		log.LOG_INFO("进入addProcessInfo方法...");
		this.outBuffer = inbuffer;
		this.inBuffer = inbuffer;
		int iResult = -1;
		String cust_id = inbuffer.getString("CUST_ID");
		String category_id = inbuffer.getString("CATEGORY_ID");
		String category_title = inbuffer.getString("CATEGORY_TITLE");
		String category_type = inbuffer.getString("CATEGORY_TYPE");
		String category_abstract = inbuffer.getString("CATEGORY_ABSTRACT");
		category_abstract=comm.setTextYin(category_abstract);
		String category_desc = inbuffer.getString("CATEGORY_DESC");
		category_desc=comm.setTextYin(category_desc);
		String category_addr = inbuffer.getString("CATEGORY_ADDR");
		String category_unit = inbuffer.getString("CATEGORY_UNIT");
		String start_date = inbuffer.getString("START_DATE");
		String end_date = inbuffer.getString("END_DATE");
		String publish_user_id = inbuffer.getString("SESSION_USER_ID");
		String publish_date = "";
		String remark = inbuffer.getString("REMARK");
		try {
			ProcessDAO processDao = new ProcessDAO();
			processDao.setCust_id(cust_id);
			processDao.setCategory_id(category_id);
			processDao.setCategory_title(category_title);
			processDao.setCategory_type(category_type);
			processDao.setCategory_abstract(category_abstract);
			processDao.setCategory_desc(category_desc);
			processDao.setCategory_addr(category_addr);
			processDao.setCategory_unit(category_unit);
			processDao.setStart_date(start_date);
			processDao.setEnd_date(end_date);

			processDao.setPublish_user_id(publish_user_id);
			processDao.setPublish_date(publish_date);
			processDao.setRemark(remark);

			iResult = addProcessInfo(processDao);
		} 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("退出addProcessInfo方法...");
	}

	public int addProcessInfo(ProcessDAO processDao) throws SaasApplicationException {

		ProcessExt processExt = new ProcessExt();
		processExt.setParam(":VCUST_ID", processDao.getCust_id());
		processExt.setParam(":VCATEGORY_ID", processDao.getCategory_id());
		processExt.setParam(":VCATEGORY_TITLE", processDao.getCategory_title());
		processExt.setParam(":VCATEGORY_TYPE", processDao.getCategory_type());
		processExt.setParam(":VCATEGORY_ABSTRACT", processDao.getCategory_abstract());
		processExt.setParam(":VCATEGORY_DESC", processDao.getCategory_desc());
		processExt.setParam(":VCATEGORY_ADDR", processDao.getCategory_addr());
		processExt.setParam(":VCATEGORY_UNIT", processDao.getCategory_unit());
		processExt.setParam(":VSTART_DATE", processDao.getStart_date());
		processExt.setParam(":VEND_DATE", processDao.getEnd_date());
		processExt.setParam(":VPUBLISH_USER_ID", processDao.getPublish_user_id());
		processExt.setParam(":VREMARK", processDao.getRemark());
		tradeQuery.executeBy(processExt.insBy("INS_BY_ALL"));
		return 0;
	}

	public void genProcess(Buffers inbuffer) {
		log.LOG_INFO("进入genProcess方法...");

		try {
			this.queryResult = genProcess();
		} catch (SaasApplicationException e) {
			log.LOG_INFO(e.getMessage());
		}
		log.LOG_INFO("退出genProcess方法...");
	}

	public ArrayList genProcess() throws SaasApplicationException {
		ArrayList processList = new ArrayList();
		ArrayList itemsList = new ArrayList();
		ProcessExt processExt = new ProcessExt();

		processList = processExt.selByList("SEL_BY_ALL");
		for (int i = 0; i < processList.size(); i++) {
			HashMap processListMap = (HashMap) processList.get(i);
			String category_title = "";
			String category_id = "";
			HashMap processMap = new HashMap();
			if (processListMap.get("category_id") != null)
				category_id = processListMap.get("category_id").toString();
			if (processListMap.get("category_title") != null)
				category_title = processListMap.get("category_title").toString();
			processMap.put("category_title", category_title);
			processMap.put("category_id", category_id);
			itemsList.add(processMap);
		}
		return itemsList;
	}

	public ArrayList genProcsss() throws SaasApplicationException {
		ArrayList processList = new ArrayList();
		ArrayList itemsList = new ArrayList();
		ProcessExt processExt = new ProcessExt();

		processList = processExt.selByList("SEL_BY_ALL");
		for (Iterator it = processList.iterator(); it.hasNext();) {
			HashMap processListMap = (HashMap) it.next();
			String category_title = "";
			String category_id = "";
			HashMap processMap = new HashMap();
			if (processListMap.get("category_id") != null)
				category_id = processListMap.get("category_id").toString();
			if (processListMap.get("category_title") != null)
				category_title = processListMap.get("category_title").toString();
			processListMap.put("category_title", category_title);
			processListMap.put("category_id", category_id);
			itemsList.add(processMap);
		}
		return itemsList;
	}

	public ArrayList searchProcess(String category_title, String category_unit) throws SaasApplicationException {
		ArrayList itemsList = new ArrayList();
		ProcessExt processExt = new ProcessExt();
		processExt.setParam(":VCATEGORY_TITLE", "%" + category_title + "%");
		processExt.setParam(":VCATEGORY_UNIT", category_unit);
		itemsList = processExt.selByList("SEL_BY_SEARCH");
		return itemsList;
	}

	// get spec sale list
	public void genSpecProcess(Buffers inbuffer) {
		log.LOG_INFO("进入genSpecProcess方法...");
		String category_unit = inbuffer.getString("SESSION_CUST_ID");
		String query_param = inbuffer.getString("QUERY_PARAM");
		try {
			if (query_param.equals(""))
				this.queryResult = genSpecProcess(category_unit);
			else
				this.queryResult = searchProcess(query_param, category_unit);
		} catch (SaasApplicationException e) {
			log.LOG_INFO(e.getMessage());
		}
		log.LOG_INFO("退出genSpecProcess方法...");
	}

	public ArrayList genSpecProcess(String category_unit) throws SaasApplicationException {
		ArrayList processList = new ArrayList();
		ProcessExt processExt = new ProcessExt();
		processExt.setParam(":VCATEGORY_UNIT", category_unit);
		processList = processExt.selByList("SEL_SPEC_PROCESS");
		return processList;
	}

	// 获取单个
	public void genOneProcess(Buffers inbuffer) {
		this.outBuffer = inbuffer;
		this.inBuffer = inbuffer;
		log.LOG_INFO("进入genOneProcess方法...");
		String category_id = inbuffer.getString("CATEGORY_ID");
		try {
			this.queryResult = genOneProcess(category_id);
		} catch (SaasApplicationException e) {
			log.LOG_INFO(e.getMessage());
		}
		log.LOG_INFO("退出genOneProcess方法...");
	}

	public ArrayList genOneProcess(String category_id) throws SaasApplicationException {
		ArrayList processList = new ArrayList();
		ProcessExt processExt = new ProcessExt();
		processExt.setParam(":VCATEGORY_ID", category_id);
		processList = processExt.selByList("SEL_ONE_PROCESS");
		return processList;
	}

	// 分页查询
	public ArrayList gentProcessByCust_id(int iStart, String cust_id) throws SaasApplicationException {
		ArrayList processList = new ArrayList();
		if (iStart == 0) {
			iStart = 0;
		} else {
			iStart = (iStart - 1) * 30;
		}
		ProcessExt processExt = new ProcessExt();
		processExt.setParam(":VCUST_ID", cust_id);
		processList = processExt.selByList("SEL_SPEC_CUST_ID", iStart, 30);
		return processList;
	}

	// 统计总数
	public int getProcessListNumber(String cust_id) throws SaasApplicationException {
		ArrayList processList = new ArrayList();
		ProcessExt processExt = new ProcessExt();
		processExt.setParam(":VCUST_ID", cust_id);
		processList = processExt.selByList("SEL_SPEC_CUST_ID");
		if (processList != null) {
			return processList.size();
		} else {
			return 0;
		}
	}

	// 修改
	public void changprocessinfo(Buffers inbuffer) {
		log.LOG_INFO("进入changprocessinfo方法...");
		this.outBuffer = inbuffer;
		this.inBuffer = inbuffer;
		ProcessDAO processdao = new ProcessDAO();
		processdao.setCust_id(inbuffer.getString("CUST_ID"));
		processdao.setCategory_id(inbuffer.getString("CATEGORY_ID"));
		processdao.setCategory_title(inbuffer.getString("CATEGORY_TITLE"));
		processdao.setCategory_type(inbuffer.getString("CATEGORY_TYPE"));
		processdao.setCategory_abstract(inbuffer.getString("CATEGORY_ABSTRACT"));
		processdao.setCategory_desc(inbuffer.getString("CATEGORY_DESC"));
		processdao.setCategory_addr(inbuffer.getString("CATEGORY_ADDR"));
		processdao.setStart_date(inbuffer.getString("START_DATE"));
		processdao.setEnd_date(inbuffer.getString("END_DATE"));
		processdao.setRemark(inbuffer.getString("REMARK"));
		int iResult = -1;
		try {
			iResult = changprocessinfo(processdao);
		} 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("退出addprocessInfo方法...");
	}

	public int changprocessinfo(ProcessDAO processdao) throws SaasApplicationException {
		log.LOG_INFO("进入changprocessinfo方法...");
		ProcessExt processExt = new ProcessExt();
		processExt.setParam(":VCUST_ID", processdao.getCust_id());
		processExt.setParam(":VCATEGORY_ID", processdao.getCategory_id());
		processExt.setParam(":VCATEGORY_TITLE", processdao.getCategory_title());
		processExt.setParam(":VCATEGORY_TYPE", processdao.getCategory_type());
		processExt.setParam(":VCATEGORY_ABSTRACT", processdao.getCategory_abstract());
		processExt.setParam(":VCATEGORY_DESC", processdao.getCategory_desc());
		processExt.setParam(":VCATEGORY_ADDR", processdao.getCategory_addr());
		processExt.setParam(":VSTART_DATE", processdao.getStart_date());
		processExt.setParam(":VEND_DATE", processdao.getEnd_date());
		processExt.setParam(":VREMARK", processdao.getRemark());
		tradeQuery.executeBy(processExt.insBy("UPDATE_BY_ONE"));
		log.LOG_INFO("退出changprocessinfo方法..." + processExt.insBy("UPDATE_BY_ONE"));
		return 0;

	}

	public void delprocessinfo(Buffers inbuffer) {
		this.outBuffer = inbuffer;
		log.LOG_INFO("进入delprocessinfo方法...");
		int iResult = -1;
		String cust_id = inbuffer.getString("CUST_ID");
		String category_id = inbuffer.getString("CATEGORY_ID");

		try {
			iResult = delprocessinfo(cust_id, category_id);
		} 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("退出delprocessinfo方法...");
	}

	public int delprocessinfo(String cust_id, String category_id) throws SaasApplicationException {
		ProcessExt processExt = new ProcessExt();
		processExt.setParam(":VCUST_ID", cust_id);
		processExt.setParam(":VCATEGORY_ID", category_id);
		tradeQuery.executeBy(processExt.insBy("DEL_BY_ID"));
		return 0;
	}
	
	public ArrayList genProcessByType(String category_type) throws SaasApplicationException {
		ArrayList processList = new ArrayList();
		ProcessExt processExt = new ProcessExt();
		processExt.setParam(":VCATEGORY_TYPE", category_type);
		processList = processExt.selByList("SEL_BY_CATEGORYTYPE");
		return processList;
	}
  
  public ArrayList getProcessByType(int iStart, int limit) throws SaasApplicationException 
	{
		if (iStart > 1) 
		{
			iStart = (iStart - 1) * limit;
		} 
		else 
		{
			iStart = 0;
		}
		ArrayList processList = new ArrayList();
		ProcessExt processExt = new ProcessExt();
		//processExt.setParam(":VCATEGORY_TYPE", category_type);
		processList = processExt.selByList("SEL_BY_CATEGORY_TYPE", iStart, limit);
		return processList;
	}

  	public int getCountsBycategory_type()
			throws SaasApplicationException {

		int size = 0;
		ArrayList processList = new ArrayList();
		ProcessExt processExt = new ProcessExt();
		//processExt.setParam(":VCATEGORY_TYPE", category_type);
		processList = processExt.selByList("SEL_BY_VCATEGORY_TYPE_CT");
		if ( processList != null && processList.size() > 0 ) 
		{
			HashMap map = (HashMap) processList.get(0);
			size = Integer.parseInt(map.get("ct").toString());
		}
		return size;
	}
}

⌨️ 快捷键说明

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