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

📄 warehouseposinfo.java

📁 java阿里巴巴代码
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
		if (nextList != null && nextList.size() > 0) {
			for (int i = 0; i < nextList.size(); i++) {
				HashMap map = (HashMap) nextList.get(i);
				TreeObject tree = new TreeObject();
				String text = map.get("pos_name").toString();
				String id = map.get("pos_id").toString();
				tree.setId(id);
				tree.setText(text);
				TreeNode node = isLeaf(cust_id, id);
				tree.setChildren(node.getChildren());
				tree.setLeaf(node.isLeaf());
				children.add(tree);
			}
		}
		return children;
	}
	
	public HashMap getAreaById(String cust_id, String pos_id) throws SaasApplicationException {

		HashMap map = new HashMap();
		ArrayList relationList = new ArrayList();
		WareHousePosExt wareHousePosExt = new WareHousePosExt();
		wareHousePosExt.setParam(":VCUST_ID", cust_id);
		wareHousePosExt.setParam(":VPOS_ID", pos_id);
		relationList = wareHousePosExt.selByList("SEL_BY_POS_ID");
		map = (HashMap) relationList.get(0);
		return map;
	}
	
	public String getPosNameById(String cust_id, String pos_id) throws SaasApplicationException {
		HashMap map = new HashMap();
		ArrayList relationList = new ArrayList();
		WareHousePosExt wareHousePosExt = new WareHousePosExt();
		wareHousePosExt.setParam(":VCUST_ID", cust_id);
		wareHousePosExt.setParam(":VPOS_ID", pos_id);
		relationList = wareHousePosExt.selByList("SEL_BY_POS_ID");
		map = (HashMap) relationList.get(0);
		String pos_name = map.get("pos_name").toString();
		return pos_name;
	}
	
	//取出所有仓位
	public ArrayList getAllPosByCustId(String cust_id,int iStart) throws SaasApplicationException 
	{
		
		ArrayList list = new ArrayList();
		WareHousePosExt wareHousePosExt = new WareHousePosExt();
		try {
			iStart = iStart*20;
			wareHousePosExt.setParam(":VCUST_ID",cust_id);
			list = wareHousePosExt.selByList("SEL_ALL_POS_BY_CUST_ID",iStart, 20);
		}
		catch (RuntimeException e) {
			log.LOG_INFO(e.getMessage());
		}
		return list;
	}
	
	public int getAllPosByCustId(String cust_id) throws SaasApplicationException 
	{
		int count=0;
		ArrayList list = new ArrayList();
		WareHousePosExt wareHousePosExt = new WareHousePosExt();
		try {
			wareHousePosExt.setParam(":VCUST_ID",cust_id);
			list = wareHousePosExt.selByList("SEL_ALL_POS_BY_CUST_ID");
		}
		catch (RuntimeException e) {
			log.LOG_INFO(e.getMessage());
		}
		if(list !=null && list.size()>0){
			count = list.size();
		}
		return count;
	}
	
	public void delWareHousePos(Buffers inbuffer) {

		log.LOG_INFO("进入delWareHousePos方法...");
		this.outBuffer = inbuffer;
		this.inBuffer = inbuffer;
		int iResult = -1;
		try {
			String cust_id = inbuffer.getString("SESSION_CUST_ID");
			String pos_id = inbuffer.getString("POS_ID");
			log.LOG_INFO("cust_id===="+cust_id+"====="+pos_id+"=====");
			iResult = delWareHousePos(cust_id,pos_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("退出delWareHousePos方法...");
	}
	
	public int delWareHousePos(String cust_id, String pos_id) throws SaasApplicationException {
		WareHousePosExt wareHousePosExt = new WareHousePosExt();
		wareHousePosExt.setParam(":VCUST_ID", cust_id);
		wareHousePosExt.setParam(":VPOS_ID", pos_id);
		tradeQuery.executeBy(wareHousePosExt.insBy("DEL_POS_BY_POS_ID"));
		return 0;
	}
	
	public int checkChildrenNode(String cust_id, String pos_id) throws SaasApplicationException {
		ArrayList list = new ArrayList();
		WareHousePosExt wareHousePosExt = new WareHousePosExt();
		wareHousePosExt.setParam(":VCUST_ID", cust_id);
		wareHousePosExt.setParam(":VUP_POS_ID", pos_id);
		list = wareHousePosExt.selByList("CHECK_CHILDREN_NODE");
		if(list != null &&list.size()>0){
			return 1;
		}else{
			return 0;
		}
	}
	
	public ArrayList getOnePosByPosId(String cust_id,String pos_id) throws SaasApplicationException 
	{
		
		ArrayList list = new ArrayList();
		WareHousePosExt wareHousePosExt = new WareHousePosExt();
		try {
			wareHousePosExt.setParam(":VCUST_ID",cust_id);
			wareHousePosExt.setParam(":VPOS_ID",pos_id);
			list = wareHousePosExt.selByList("SEL_ONE_POS_BY_POS_ID");
		}
		catch (RuntimeException e) {
			log.LOG_INFO(e.getMessage());
		}
		return list;
	}

	
	public Map getOnePosByHouseId(String cust_id,String house_id) throws SaasApplicationException 
	{
		ArrayList list = new ArrayList();
		WareHousePosExt wareHousePosExt = new WareHousePosExt();
		wareHousePosExt.setParam(":VCUST_ID",cust_id);
		wareHousePosExt.setParam(":VHOUSE_ID",house_id);
		list = wareHousePosExt.selByList("SEL_ONE_POS_BY_HOUSE_ID");
		String pos_id="",pos_name="";
		Map childMap=new HashMap();
		HashMap map = new HashMap();
		if(list!=null&&list.size()>0){
			for (int i = 0; i < list.size(); i++) {
				map = (HashMap)list.get(i);
				if( map.get("pos_id")!=null){
					pos_id= map.get("pos_id").toString();
				}
				if( map.get("pos_name")!=null){
					pos_name= map.get("pos_name").toString();
				}
				childMap.put(pos_id,pos_name);
			}
		}
		return childMap;
	}
	
	public int getPosByHouseId(String cust_id,String house_id) throws SaasApplicationException 
	{
		ArrayList list = new ArrayList();
		WareHousePosExt wareHousePosExt = new WareHousePosExt();
		wareHousePosExt.setParam(":VCUST_ID",cust_id);
		wareHousePosExt.setParam(":VHOUSE_ID",house_id);
		list = wareHousePosExt.selByList("SEL_ONE_POS_BY_HOUSE_ID");
		String max_capacity="";
		int all_value=0;
		HashMap map = new HashMap();
		if(list!=null&&list.size()>0){
			for (int i = 0; i < list.size(); i++) {
				map = (HashMap)list.get(i);
				if( map.get("max_capacity")!=null){
					max_capacity= map.get("max_capacity").toString();
					all_value+=Integer.parseInt(max_capacity);
				}
			}
		}
		return all_value;
	}
	
	public int getPosNumByHouseId(String cust_id,String house_id) throws SaasApplicationException 
	{
		ArrayList list = new ArrayList();
		int count = 0;
		WareHousePosExt wareHousePosExt = new WareHousePosExt();
		wareHousePosExt.setParam(":VCUST_ID",cust_id);
		wareHousePosExt.setParam(":VHOUSE_ID",house_id);
		list = wareHousePosExt.selByList("SEL_ONE_POS_BY_HOUSE_ID");
		if(list!=null && list.size()>0){
			count = list.size();
		}
		return count;
	}
	
	public int getAllAreaNo(String cust_id,String house_id) throws SaasApplicationException 
	{
		ArrayList list = new ArrayList();
		WareHousePosExt wareHousePosExt = new WareHousePosExt();
		wareHousePosExt.setParam(":VCUST_ID",cust_id);
		wareHousePosExt.setParam(":VHOUSE_ID",house_id);
		list = wareHousePosExt.selByList("SEL_ONE_POS_BY_HOUSE_ID");
		String pos_area="";
		int all_value=0;
		HashMap map = new HashMap();
		if(list!=null&&list.size()>0){
			for (int i = 0; i < list.size(); i++) {
				map = (HashMap)list.get(i);
				if( map.get("pos_area")!=null){
					pos_area= map.get("pos_area").toString();
					all_value+=Integer.parseInt(pos_area);
				}
			}
		}
		return all_value;
	}
	
	public ArrayList getWareHousePosById(String cust_id) throws SaasApplicationException {

		ArrayList relationList = new ArrayList();
		WareHousePosExt relaExt = new WareHousePosExt();
		relaExt.setParam(":VCUST_ID", cust_id);
		relationList = relaExt.selByList("SEL_WHP_BY_ID");
		return relationList;
	}
	
}

⌨️ 快捷键说明

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