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

📄 carinfo.java

📁 java阿里巴巴代码
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
			carDao.setRemark(remark);

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

	public int editCarInfo(CarDao carDao) throws SaasApplicationException {

		CarExt carExt = new CarExt();

		carExt.setParam(":VCUST_ID", carDao.getCust_id());
		carExt.setParam(":VAUTO_ID", carDao.getAuto_id());
		carExt.setParam(":VMOTOR_O", carDao.getMotor_o());
		carExt.setParam(":VTAG_NO", carDao.getTag_no());
		carExt.setParam(":VBRAND", carDao.getBrand());
		carExt.setParam(":VAUTO_TYPE", carDao.getAuto_type());
		carExt.setParam(":VAUTO_COLOR", carDao.getAuto_color());
		carExt.setParam(":VROAD_NUM", carDao.getRoad_num());
		carExt.setParam(":VWEIGHT", carDao.getWeight());
		carExt.setParam(":VLINK_NUM", carDao.getLink_num());
		carExt.setParam(":VFRAME_NOW", carDao.getFrame_now());
		carExt.setParam(":VOIL_TYPE", carDao.getOil_type());
		carExt.setParam(":VOWN", carDao.getOwn());
		carExt.setParam(":VPRODUCT_ADDR", carDao.getProduct_addr());
		carExt.setParam(":VTAX_DATE", carDao.getTax_date());
		carExt.setParam(":VCHECK_END_DATE", carDao.getCheck_end_date());
		carExt.setParam(":VIN_DATE", carDao.getIn_date());
		carExt.setParam(":VBUY_DATE", carDao.getBuy_date());
		carExt.setParam(":VOWN_USER", carDao.getOwn_user());
		carExt.setParam(":VOWN_TEAM_ID", carDao.getOwn_team_id());
		carExt.setParam(":VCHECK_DATE", carDao.getCheck_date());
		carExt.setParam(":VSTATE_CODE", carDao.getState_code());
		carExt.setParam(":VSTATE_CODE_DATE", carDao.getState_code_date());
		carExt.setParam(":VRSRV_STR1", carDao.getRsrv_str1());
		carExt.setParam(":VRSRV_STR2", carDao.getRsrv_str2());
		carExt.setParam(":VRSRV_STR3", carDao.getRsrv_str3());
		carExt.setParam(":VRSRV_STR4", carDao.getRsrv_str4());
		carExt.setParam(":VRSRV_STR5", carDao.getRsrv_str5());
		carExt.setParam(":VRSRV_STR8", carDao.getRsrv_str8());
		carExt.setParam(":VRSRV_STR9", carDao.getRsrv_str9());
		carExt.setParam(":VRSRV_STR10", carDao.getRsrv_str10());
		carExt.setParam(":VOPER_DATE", carDao.getOper_date());
		carExt.setParam(":VUSER_ID", carDao.getUser_id());
		carExt.setParam(":VREMARK", carDao.getRemark());
		tradeQuery.executeBy(carExt.insBy("EDIT_BY_ALL"));
		return 0;
	}

	// 删除车辆信息

	public void delCarInfo(Buffers inbuffer) {

		log.LOG_INFO("进入delCarInfo方法...");
		this.outBuffer = inbuffer;
		this.inBuffer = inbuffer;
		int iResult = -1;
		String auto_id = inbuffer.getString("AUTO_ID");
		try {
			CarDao carDao = new CarDao();
			carDao.setAuto_id(auto_id);
			iResult = delCarInfo(carDao);
		} 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("退出delCarInfo方法...");
	}

	public int delCarInfo(CarDao carDao) throws SaasApplicationException {

		CarExt carExt = new CarExt();
		carExt.setParam(":VAUTO_ID", carDao.getAuto_id());
		tradeQuery.executeBy(carExt.insBy("DEL_BY_ID"));
		return 0;
	}

	/**
	 * @param iStart
	 * @param cust_id
	 * @return 取出自己车辆信息
	 * @throws SaasApplicationException
	 */
	public ArrayList getCarByCust(int iStart, String cust_id)
			throws SaasApplicationException {

		if (iStart > 1) {
			iStart = (iStart - 1) * 20;
		} else {
			iStart = 0;
		}
		CarExt carExt = new CarExt();
		carExt.setParam(":VCUST_ID", cust_id);
		ArrayList list = carExt.selByList("SEL_BY_CUST", iStart, 20);
		return list;
	}
	
	public ArrayList getCarByCust_ID(int iStart, String cust_id)
			throws SaasApplicationException {

		if (iStart > 1) {
			iStart = (iStart - 1) * 20;
		} else {
			iStart = 0;
		}
		CarExt carExt = new CarExt();
		carExt.setParam(":VCUST_ID", cust_id);
		ArrayList list = carExt.selByList("SEL_BY_CUST_ID", iStart, 20);
		return list;
	}

	/**
	 * @param cust_id
	 * @return 取出自己车辆总数
	 * @throws SaasApplicationException
	 */
	public int getCarCountByCust(String cust_id)
			throws SaasApplicationException {

		int size = 0;
		CarExt carExt = new CarExt();
		carExt.setParam(":VCUST_ID", cust_id);
		ArrayList list = carExt.selByList("SEL_COUNT_BY_CUST");
		if (list != null && list.size() > 0) {
			HashMap map = (HashMap) list.get(0);
			size = Integer.parseInt(map.get("ct").toString());
		}
		return size;
	}

	/**
	 * @param team_id
	 * @return 取出单条信息
	 * @throws SaasApplicationException
	 */
	public HashMap getCarById(String auto_id) throws SaasApplicationException {

		HashMap map = new HashMap();
		CarExt carExt = new CarExt();
		carExt.setParam(":VAUTO_ID", auto_id);
		ArrayList list = carExt.selByList("SEL_BY_ID");
		if (list != null && list.size() > 0) {
			map = (HashMap) list.get(0);
		}
		return map;
	}

	public String getCarTagNoById(String auto_id)
			throws SaasApplicationException {

		HashMap map = new HashMap();
		CarExt carExt = new CarExt();
		carExt.setParam(":VAUTO_ID", auto_id);
		ArrayList list = carExt.selByList("SEL_BY_ID");
		String tag_no = "";
		if (list != null && list.size() > 0) {
			map = (HashMap) list.get(0);
			if (map.get("tag_no") != null) {
				tag_no = map.get("tag_no").toString();
			}
		}
		return tag_no;
	}

	public String getCarByJson(int iStart, String cust_id)
			throws SaasApplicationException {

		String json = "";
		int size = getCarCountByCust(cust_id);
		JSONArray array = new JSONArray();
		ArrayList list = new ArrayList();
		CarExt carExt = new CarExt();
		carExt.setParam(":VCUST_ID", cust_id);
		list = carExt.selByList("SEL_BY_CUST", iStart, 10);
		if (list != null && list.size() > 0) {
			for (int i = 0; i < list.size(); i++) {
				JSONObject obj = new JSONObject();
				HashMap map = (HashMap) list.get(i);
				String id = map.get("auto_id").toString();
				String motor_o = "";
				String tag_no = "";
				String brand = "";
				String auto_type = "";
				if (map.get("motor_o") != null) {
					motor_o = map.get("motor_o").toString();
				}
				if (map.get("tag_no") != null) {
					tag_no = map.get("tag_no").toString();
				}
				if (map.get("brand") != null) {
					brand = map.get("brand").toString();
				}
				if (map.get("auto_type") != null) {
					auto_type = map.get("auto_type").toString();
				}
				obj.put("id", id);
				obj.put("motor_o", motor_o);
				obj.put("tag_no", tag_no);
				obj.put("brand", brand);
				obj.put("auto_type", auto_type);
				array.add(obj);
			}
		}
		JSONObject root = new JSONObject();
		root.put("root", array);
		root.put("totalCount", size);
		json = root.toString();
		return json;
	}

	// 王洋加
	public ArrayList getCarAndTeamById(String cust_id)
			throws SaasApplicationException {

		ArrayList relationList = new ArrayList();
		CarExt relaExt = new CarExt();
		relaExt.setParam(":VCUST_ID", cust_id);
		relationList = relaExt.selByList("SEL_BY_CUST");

		return relationList;
	}

	public ArrayList getValueById(String cust_id)
			throws SaasApplicationException {

		ArrayList relationList = new ArrayList();
		CarExt relaExt = new CarExt();
		relaExt.setParam(":VCUST_ID", cust_id);
		relationList = relaExt.selByList("SEL_BY_CUST");

		return relationList;
	}
	
	public Map getOneCarByTeamId(String cust_id,String team_id) throws SaasApplicationException 
	{
		ArrayList list = new ArrayList();
		CarExt relaExt = new CarExt();
		relaExt.setParam(":VCUST_ID",cust_id);
		relaExt.setParam(":VTEAM_ID",team_id);
		list = relaExt.selByList("SEL_ONE_CAR_BY_TEAM_ID");
		String auto_id="",tag_no="";
		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("auto_id")!=null){
					auto_id= map.get("auto_id").toString();
				}
				if( map.get("tag_no")!=null){
					tag_no= map.get("tag_no").toString();
				}
				childMap.put(auto_id,tag_no);
			}
		}
		return childMap;
	}
}

⌨️ 快捷键说明

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