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

📄 motorcadeinfo.java

📁 java阿里巴巴代码
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
			motorDao.setShip_type(ship_type);
			motorDao.setOper_date(oper_date);
			motorDao.setRsrv_str1(rsrv_str1);
			motorDao.setRsrv_str2(rsrv_str2);
			motorDao.setRsrv_str4(rsrv_str4);
			motorDao.setRsrv_str3(rsrv_str3);
			motorDao.setRsrv_str8(rsrv_str8);
			motorDao.setRsrv_str9(rsrv_str9);
			motorDao.setRsrv_str5(rsrv_str5);
			motorDao.setRsrv_str10(rsrv_str10);
			motorDao.setUser_id(user_id);
			iResult = editMotorCadeInfo(motorDao);
		} 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("退出editMotorCadeInfo方法...");
	}

	public int editMotorCadeInfo(MotorCadeDao motorDao)
			throws SaasApplicationException {

		MotorCadeExt motorExt = new MotorCadeExt();
		motorExt.setParam(":VCONTACT", motorDao.getContact());
		motorExt.setParam(":VCUST_ID", motorDao.getCust_id());
		motorExt.setParam(":VTEAM_ID", motorDao.getTeam_id());
		motorExt.setParam(":VCREATE_DATE", motorDao.getCreate_date());
		motorExt.setParam(":VSHIP_NUM", motorDao.getShip_num());
		motorExt.setParam(":VSALE_MAN", motorDao.getSale_man());
		motorExt.setParam(":VTEAM_NAME", motorDao.getTeam_name());
		motorExt.setParam(":VTEAM_NO", motorDao.getTeam_no());
		motorExt.setParam(":VSHIP_RAGE", motorDao.getShip_rage());
		motorExt.setParam(":VCONTACT_PHPNE", motorDao.getContact_phpne());
		motorExt.setParam(":VAUTO_NUM", motorDao.getAuto_num());
		motorExt.setParam(":VREMARK", motorDao.getRemark());
		motorExt.setParam(":VSTATE_CODE_DATE", motorDao.getState_code_date());
		motorExt.setParam(":VSTATE_CODE", motorDao.getState_code());
		motorExt.setParam(":VOWN_USER_ID", motorDao.getOwn_user_id());
		motorExt.setParam(":VSHIP_TYPE", motorDao.getShip_type());
		motorExt.setParam(":VOPER_DATE", motorDao.getOper_date());
		motorExt.setParam(":VRSRV_STR1", motorDao.getRsrv_str1());
		motorExt.setParam(":VRSRV_STR2", motorDao.getRsrv_str2());
		motorExt.setParam(":VRSRV_STR4", motorDao.getRsrv_str4());
		motorExt.setParam(":VRSRV_STR3", motorDao.getRsrv_str3());
		motorExt.setParam(":VRSRV_STR8", motorDao.getRsrv_str8());
		motorExt.setParam(":VRSRV_STR9", motorDao.getRsrv_str9());
		motorExt.setParam(":VRSRV_STR5", motorDao.getRsrv_str5());
		motorExt.setParam(":VRSRV_STR10", motorDao.getRsrv_str10());
		motorExt.setParam(":VUSER_ID", motorDao.getUser_id());
		tradeQuery.executeBy(motorExt.insBy("EDIT_BY_ALL"));
		return 0;
	}

	// 删除车队信息

	public void delMotorCadeInfo(Buffers inbuffer) {

		log.LOG_INFO("进入delMotorCadeInfo方法...");
		this.outBuffer = inbuffer;
		this.inBuffer = inbuffer;
		int iResult = -1;
		String cust_id = inbuffer.getString("SESSION_CUST_ID");
		String team_id = inbuffer.getString("TEAM_ID");
		try {
			MotorCadeDao motorDao = new MotorCadeDao();
			motorDao.setCust_id(cust_id);
			motorDao.setTeam_id(team_id);
			iResult = delMotorCadeInfo(motorDao);
		} 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("退出delMotorCadeInfo方法...");
	}

	public int delMotorCadeInfo(MotorCadeDao motorDao)
			throws SaasApplicationException {

		MotorCadeExt motorExt = new MotorCadeExt();
		motorExt.setParam(":VCUST_ID", motorDao.getCust_id());
		motorExt.setParam(":VTEAM_ID", motorDao.getTeam_id());
		tradeQuery.executeBy(motorExt.insBy("DEL_BY_ID"));
		return 0;
	}

	/**
	 * @param iStart
	 * @param cust_id
	 * @return 取出自己车队信息
	 * @throws SaasApplicationException
	 */
	public ArrayList getMororCadeByCust(int iStart, String cust_id)
			throws SaasApplicationException {
			iStart = iStart * 20;
		MotorCadeExt motorExt = new MotorCadeExt();
		motorExt.setParam(":VCUST_ID", cust_id);
		ArrayList list = motorExt.selByList("SEL_BY_CUST", iStart, 20);
		return list;
	}

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

		int size = 0;
		MotorCadeExt motorExt = new MotorCadeExt();
		motorExt.setParam(":VCUST_ID", cust_id);
		ArrayList list = motorExt.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 getMotorCadeById(String team_id)
			throws SaasApplicationException {

		HashMap map = new HashMap();
		MotorCadeExt motorExt = new MotorCadeExt();
		motorExt.setParam(":VTEAM_ID", team_id);
		ArrayList list = motorExt.selByList("SEL_BY_ID");
		if (list != null && list.size() > 0) {
			map = (HashMap) list.get(0);
		}
		return map;
	}

	/**
	 * 
	 * @param team_id
	 * @return 返回车队名称
	 * @throws SaasApplicationException
	 */
	public String getMotorCadeNameById(String team_id)
			throws SaasApplicationException {
		String team_name = "";
		HashMap map = getMotorCadeById(team_id);
		if (map.get("team_name") != null) {
			team_name = map.get("team_name").toString();
		}
		return team_name;
	}

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

		String json = "";
		int size = getMororCadeCountByCust(cust_id);
		JSONArray array = new JSONArray();
		ArrayList list = new ArrayList();
		MotorCadeExt motorExt = new MotorCadeExt();
		motorExt.setParam(":VCUST_ID", cust_id);
		list = motorExt.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("team_id").toString();
				String team_name = "";
				String team_no = "";
				String auto_num = "";
				String date = "";
				if (map.get("team_name") != null) {
					team_name = map.get("team_name").toString();
				}
				if (map.get("team_no") != null) {
					team_no = map.get("team_no").toString();
				}
				if (map.get("auto_num") != null) {
					auto_num = map.get("auto_num").toString();
				}
				if (map.get("create_date") != null) {
					date = map.get("create_date").toString();
					if (date.length() > 10) {
						date = date.substring(0, 10);
					}
				}
				obj.put("id", id);
				obj.put("team_name", team_name);
				obj.put("team_no", team_no);
				obj.put("auto_num", auto_num);
				obj.put("date", date);
				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();
		MotorCadeExt relaExt = new MotorCadeExt();
		relaExt.setParam(":VCUST_ID", cust_id);
		relationList = relaExt.selByList("SEL_BY_CUST");

		return relationList;
	}
}

⌨️ 快捷键说明

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