/** * 根据处理状态查询计费信息 * * @author 左香勇 2014-9-25 * @update * @param state 处理状态 pageRoll 分页查询对象 * @return List<ConsumerOrderGoodsinfoData> 计费信息 * @since vmaque 1.5 */ public List<ConsumerOrderGoodsinfoData> getAccountList(PageRoll pageRoll, Integer state) { // 定义查询语句 StringBuffer querySql = new StringBuffer("select * from(SELECT "); querySql.append("MCG.ID AS ID,"); querySql.append("MCO.PAYTYPE AS PAYTYPE,MCO.PRICE AS PRICE,"); querySql.append("MCO.STATE AS STATE,MCO.PAYTIME AS PAYTIME,"); querySql.append("MCO.ID AS MCOID,MCO.TRANSFERTIME AS TRANSFERTIME,"); querySql.append("MCO.TRANSFERPRICE AS TRANSFERPRICE,"); querySql.append("MCO.TRANSFERPEOPLE AS TRANSFERPEOPLE,"); querySql.append("ac.receivableaccount AS RECEIVABLEACCOUNT, "); querySql.append("ac.accounttype as acctype "); querySql.append("FROM MINI_CONSUMERORDER_GOODSINFO MCG "); querySql.append("JOIN MINI_CONSUMERORDER MCO ON MCG.CONSUMERORDERID = MCO.ID "); querySql.append("JOIN MINI_PAGE MPG ON MCO.PAGEID = MPG.ID "); querySql.append("JOIN CTN_SYSUSER CSU ON MPG.USER_ID = CSU.ID "); querySql.append("join MINI_ACCOUNTNUMBER ac on ac.userid=csu.id "); querySql.append("WHERE MCO.STATE = ? ) "); querySql.append("where PAYTYPE=acctype"); List<Object> objects = new ArrayList<Object>(); objects.add(state); // 分页查询 pageRoll.setCountSQL("SELECT COUNT(1) FROM (" + querySql.toString() + ")"); pageRoll.setSearchSQL(querySql.toString()); JdbcDao jdbcDao = (JdbcDao) SpringContextHelper.getBean("jdbc"); // 获取jdbc List<ETIPResultSet> rsList = jdbcDao.search(pageRoll, objects); List<ConsumerOrderGoodsinfoData> consumerOrderGoodsinfoDatas = new ArrayList<ConsumerOrderGoodsinfoData>(); for (int i = 0; i < rsList.size(); i++) { ConsumerOrderGoodsinfoData consumerOrderGoodsinfoData = new ConsumerOrderGoodsinfoData(); ConSumerOrderData sumerOrderData = new ConSumerOrderData(); UserData userData = new UserData(); PageData pageData = new PageData(); userData.setReceivableAccount(rsList.get(i).getString("RECEIVABLEACCOUNT")); pageData.setUserData(userData); sumerOrderData.setPageData(pageData); sumerOrderData.setId(rsList.get(i).getString("MCOID")); sumerOrderData.setPrice(rsList.get(i).getDouble("PRICE")); sumerOrderData.setState(rsList.get(i).getInt("STATE")); sumerOrderData.setPayType(rsList.get(i).getInt("PAYTYPE")); sumerOrderData.setPayTime(rsList.get(i).getDate("PAYTIME")); sumerOrderData.setTransferPeople(rsList.get(i).getString("TRANSFERPEOPLE")); sumerOrderData.setTransferPrice(rsList.get(i).getDouble("TRANSFERPRICE")); sumerOrderData.setTransferTime(rsList.get(i).getDate("TRANSFERTIME")); consumerOrderGoodsinfoData.setConSumerOrderData(sumerOrderData); consumerOrderGoodsinfoData.setId(rsList.get(i).getString("ID")); consumerOrderGoodsinfoDatas.add(consumerOrderGoodsinfoData); } return consumerOrderGoodsinfoDatas; }
/** * 更具订单id和用户id查询订单的详细信息 包括实名认证信息和发票信息<br> * * @author 冯鑫 <br> * 2014-4-22 * @update 侯杨 * @param orderId 订单id 必须不为空 userId 当前登录用户id 必须不为空 * @return OrderData */ public OrderData findAllOrderDatebyOrderId(String orderId) { OrderData orderData = orderPersistence.retrieve(orderId); // 订单的信息 BusinessUserData bUserData = getBuserByOrderId(orderId); // 根据订单id查询认证信息 List<OrderProductData> orderProductDatas = getOPsByOrderId(orderId); // 根据订单id查询订单服务中间表信息 // 不是官方发布权限 if (orderProductDatas.get(0).getPageId() != null && !"".equals(orderProductDatas.get(0).getPageId())) { // 查询page表 PageData pageData = pagePersistence.retrieve(orderProductDatas.get(0).getPageId()); // 查询page域名信息 PageInfoExtraData pageInfoExtraData = new PageInfoExtraData(); pageInfoExtraData.setType("2"); pageInfoExtraData.setPageId(pageData.getId()); pageInfoExtraData = pageInfoExtraPersistence.searchByPageInfoExtraData(pageInfoExtraData); pageData.setPageInfoExtra(pageInfoExtraData); orderData.setPageData(pageData); } orderData.setBusinessUserData(bUserData); orderData.setOrderProductDatas(orderProductDatas); if (null != orderData && orderData.getInvoiceId() != null && !"".equals(orderData.getInvoiceId())) { InvoiceData invoiceData = invoicePersistence.retrieve(orderData.getInvoiceId()); orderData.setInvoiceData(invoiceData); } return orderData; }
/** * 根据查询条件分页查询出符合条件的商品订单信息 * * @author 左香勇 2014-9-9 * @update * @return String 返回跳转到指定页面的字符串 * @since vmaque 1.5 */ public String toconSumerOrderManager() { String pageId = request.getParameter("pageid"); // pageid String state = request.getParameter("state"); PageData pageData = new PageData(); pageData.setId(pageId); PageData paData = pageManageFacade.findPageDataById(pageData); PageInfoExtraData pageInfoExtraData = new PageInfoExtraData(); pageInfoExtraData.setPageId(pageId); PageInfoExtraData piData = pageInfoExtraFacade.searchByPageId(pageInfoExtraData); conSumerOrderData.setPageId(pageId); if (state != null && !"".equals(state)) { conSumerOrderData.setState(Integer.parseInt(state)); } // 查询订单分页信息 List<ConsumerOrderGoodsinfoData> list = orderManagerFacade.getConSumerOrderGoodsInfoDataList(pageRoll, conSumerOrderData); // 查询各订单统计信息,并存储到map中 Map<String, Integer> orderNumMap = new HashMap<String, Integer>(); orderNumMap.put("type0", orderManagerFacade.serachOrderNum(pageId, 0)); orderNumMap.put("type1", orderManagerFacade.serachOrderNum(pageId, 1)); orderNumMap.put("type2", orderManagerFacade.serachOrderNum(pageId, 2)); // 把查询到的订单传到前台 request.setAttribute("orderNumMap", orderNumMap); // 把查询的分页订单集合传到前台 request.setAttribute("listOrderManager", list); String path = ReadDomain.readProperties(); request.setAttribute("path", path); // 把page访问路径传到前台 if (piData != null && !"".equals(piData)) { if (piData.getDomain() != null && !"".equals(piData.getDomain())) { this.request.setAttribute("pageUrl", piData.getDomain()); } } // 把page名称传到前台 if (paData.getName() != null && !"".equals(paData.getName())) { this.request.setAttribute("pageName", paData.getName()); } // 把pageid传到前台 request.setAttribute("pageid", pageId); // 把当前订单状态传到前台 request.setAttribute("state", state); return "toconSumerOrderManager"; }
/** * 根据订单商品信息中间表Id查询的商品订单信息(后台) * * @author 左香勇 2014-9-15 * @update * @param consumerOrderGoodsinfoDataId 订单商品信息中间表id * @return ConsumerOrderGoodsinfoData 订单商品信息中间实体 * @since vmaque 1.5 */ public ConsumerOrderGoodsinfoData getConSumerOrderGoodsInfoDataById( String consumerOrderGoodsinfoDataId) { // 定义查询语句 StringBuffer querySql = new StringBuffer("SELECT "); querySql.append("MCG.ID AS ID,MCG.GOODSNUM AS GOODSNUM,"); querySql.append("MCO.ID AS CONSUMERORDERID,MCO.PRICE AS PRICE,MCO.STATE AS STATE,"); querySql.append("MCO.CREATETIME AS CREATETIME,MCO.LOGISTICSCOMPANY AS LOGISTICSCOMPANY,"); querySql.append("MCO.LOGISTICSNUMBER AS LOGISTICSNUMBER,MCO.DELIVERTIME AS DELIVERTIME,"); querySql.append("MCC.CONFIGNAME AS CONFIGNAME,"); querySql.append("MGI.GOODSNAME AS GOODSNAME,"); querySql.append( "MCU.USERNAME AS USERNAME,MCU.USERADDRESS AS USERADDRESS,MCU.USERMOBILE AS USERMOBILE,"); querySql.append("MPE.DOMAIN AS DOMAIN,MPG.NAME AS PAGENAME,"); querySql.append("CSU.RECEIVABLEACCOUNT AS RECEIVABLEACCOUNT,CSU.ACCOUNTTYPE AS ACCOUNTTYPE,"); querySql.append("CSU.LOGINMAIL AS LOGINMAIL,CSU.LOGINMOBLE AS LOGINMOBLE "); querySql.append("FROM MINI_CONSUMERORDER_GOODSINFO MCG "); querySql.append("JOIN MINI_CONSUMERORDER MCO ON MCG.CONSUMERORDERID = MCO.ID "); querySql.append("JOIN MINI_COMMODITYCONFIG MCC ON MCG.COMMODITYCONFIGID = MCC.ID "); querySql.append("JOIN MINI_GOODSINFO MGI ON MCG.GOODSINFID = MGI.ID "); querySql.append("JOIN MINI_CONSUMERUSER MCU ON MCO.CONSUMERUSERID = MCU.ID "); querySql.append("JOIN MINI_PAGE MPG ON MCO.PAGEID=MPG.ID "); querySql.append("JOIN CTN_SYSUSER CSU ON MPG.USER_ID=CSU.ID "); querySql.append("RIGHT JOIN MINI_PAGE_INFO_EXTRA MPE ON MPG.ID=MPE.PAGE_ID "); querySql.append("WHERE MCG.ISDELETE = 1 AND MCO.ISDELETE = 1 "); querySql.append("AND MCC.ISDELETE = 1 AND MGI.ISDELETE = 1 AND MCU.ISDELETE = 1 "); querySql.append("AND MCG.ID = ?"); JdbcDao jdbcDao = (JdbcDao) SpringContextHelper.getBean("jdbc"); // 获取jdbc List<ETIPResultSet> rsList = jdbcDao.queryForList(querySql.toString(), new Object[] {consumerOrderGoodsinfoDataId}); if (rsList.size() > 0) { ConsumerOrderGoodsinfoData consumerOrderGoodsinfoData = new ConsumerOrderGoodsinfoData(); ConSumerOrderData sumerOrderData = new ConSumerOrderData(); GoodsInfoData goodsInfoData = new GoodsInfoData(); CommodityConfigData commodityConfigData = new CommodityConfigData(); ConSumerUserData conSumerUserData = new ConSumerUserData(); PageData pageData = new PageData(); PageInfoExtraData pageInfoExtraData = new PageInfoExtraData(); UserData userData = new UserData(); // 给登录用户表添加数据 userData.setAccountType(rsList.get(0).getInt("ACCOUNTTYPE")); userData.setReceivableAccount(rsList.get(0).getString("RECEIVABLEACCOUNT")); userData.setLoginMail(rsList.get(0).getString("LOGINMAIL")); userData.setLoginMoble(rsList.get(0).getString("LOGINMOBLE")); // 给Page信息表添加数据 pageInfoExtraData.setDomain(rsList.get(0).getString("DOMAIN")); // 给page表添加数据 pageData.setName(rsList.get(0).getString("PAGENAME")); pageData.setUserData(userData); pageData.setPageInfoExtra(pageInfoExtraData); // 给订单用户信息表添加数据 conSumerUserData.setUserName(rsList.get(0).getString("USERNAME")); conSumerUserData.setUserAddress(rsList.get(0).getString("USERADDRESS")); conSumerUserData.setUserMobile(rsList.get(0).getString("USERMOBILE")); // 给订单表添加数据 sumerOrderData.setConSumerUserData(conSumerUserData); sumerOrderData.setPageData(pageData); sumerOrderData.setId(rsList.get(0).getString("CONSUMERORDERID")); sumerOrderData.setCreateTime(rsList.get(0).getDate("CREATETIME")); sumerOrderData.setPrice(rsList.get(0).getDouble("PRICE")); sumerOrderData.setState(rsList.get(0).getInt("STATE")); sumerOrderData.setLogisticsCompany(rsList.get(0).getString("LOGISTICSCOMPANY")); sumerOrderData.setLogisticsNumber(rsList.get(0).getString("LOGISTICSNUMBER")); sumerOrderData.setDeliverTime(rsList.get(0).getDate("DELIVERTIME")); // 给规格表添加数据 commodityConfigData.setConfigName(rsList.get(0).getString("CONFIGNAME")); // 给商品表添加数据 goodsInfoData.setGoodsName(rsList.get(0).getString("GOODSNAME")); // 给订单商品中间表添加数据 consumerOrderGoodsinfoData.setCommodityConfigData(commodityConfigData); consumerOrderGoodsinfoData.setGoodsInfoData(goodsInfoData); consumerOrderGoodsinfoData.setConSumerOrderData(sumerOrderData); consumerOrderGoodsinfoData.setGoodsNum(rsList.get(0).getInt("GOODSNUM")); consumerOrderGoodsinfoData.setId(rsList.get(0).getString("ID")); return consumerOrderGoodsinfoData; } return null; }