Search in sources :

Example 11 with PayInfo

use of com.itrus.portal.db.PayInfo in project portal by ixinportal.

the class DownLoadCertWebController method toPages.

/**
 * 跳转到下载成功或失败页面 2016年11月3日 下午4:52:36
 *
 * @param id
 *            订单id
 * @param ret
 *            参数 1 成功, 0失败
 * @return 逻辑视图
 */
@RequestMapping(value = "/toPages/{id}", produces = "text/html")
public String toPages(@PathVariable("id") Long id, @RequestParam(value = "ret", required = false) int ret, HttpServletRequest request, Model uiModel) {
    HttpSession session = request.getSession();
    UserInfo userInfo = (UserInfo) session.getAttribute("webuserInfo");
    Enterprise enterprise = (Enterprise) session.getAttribute("webenterprise");
    if (null == userInfo || null == enterprise) {
        return "redirect:/userInfoWeb/denglu.html";
    }
    Map<String, Object> param = new HashMap<String, Object>();
    // 设置查询条件,选择属于当前用户,当前企业的订单
    param.put("id", id);
    List<Map<String, Object>> billAll = sqlSession.selectList("com.itrus.portal.db.BillMapper.selectProductBillCertById", param);
    if (0 == billAll.size()) {
        return "redirect:/userInfoWeb/denglu.html";
    }
    // 审核记录
    ReviewLog reviewLog = reviewLogService.getReviewLog(id);
    if (reviewLog != null) {
        uiModel.addAttribute("reviewLog", reviewLog);
    }
    uiModel.addAttribute("bills", billAll.get(0));
    // 获取订单在线支付方式
    if (billAll.get(0).get("on_pay_info") != null) {
        OnPayInfo onPayInfo = sqlSession.selectOne("com.itrus.portal.db.OnPayInfoMapper.selectByPrimaryKey", billAll.get(0).get("on_pay_info"));
        uiModel.addAttribute("onPayInfo", onPayInfo);
    } else if (billAll.get(0).get("pay_info") != null) {
        PayInfo payInfo = sqlSession.selectOne("com.itrus.portal.db.PayInfoMapper.selectByPrimaryKey", billAll.get(0).get("pay_info"));
        uiModel.addAttribute("payInfo", payInfo);
    }
    UserCertExample uce = new UserCertExample();
    UserCertExample.Criteria ucec = uce.or();
    ucec.andBillEqualTo(id);
    List<String> certStatus = new ArrayList<String>();
    List<UserCert> certs = userCertService.getUserCertByBill(id, certStatus);
    certStatus.add(ComNames.CERT_STATUS_1);
    certStatus.add(ComNames.CERT_STATUS_2);
    if (ret == 1) {
        // 下载成功页面
        if (certs != null && certs.size() > 0) {
            UserCert userCert = certs.get(0);
            uiModel.addAttribute("doneTime", userCert.getCertStartTime());
        }
        return "ixinweb/dingdanxiangqing_xiazaichenggong";
    } else {
        // 下载失败页面
        return "ixinweb/dingdanxiangqing_xiazaishibai";
    }
}
Also used : HashMap(java.util.HashMap) HttpSession(javax.servlet.http.HttpSession) UserCertExample(com.itrus.portal.db.UserCertExample) ArrayList(java.util.ArrayList) UserInfo(com.itrus.portal.db.UserInfo) OnPayInfo(com.itrus.portal.db.OnPayInfo) PayInfo(com.itrus.portal.db.PayInfo) OnPayInfo(com.itrus.portal.db.OnPayInfo) Enterprise(com.itrus.portal.db.Enterprise) ReviewLog(com.itrus.portal.db.ReviewLog) JSONObject(com.alibaba.fastjson.JSONObject) Map(java.util.Map) HashMap(java.util.HashMap) UserCert(com.itrus.portal.db.UserCert) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 12 with PayInfo

use of com.itrus.portal.db.PayInfo in project portal by ixinportal.

the class ExtraBillWebController method refusePage.

// 审核拒绝页面
@RequestMapping(value = "/refusebill/{id}.html", produces = "text/html")
public String refusePage(@PathVariable("id") Long id, @RequestParam(value = "processProgress", required = false) Long processProgress, Model uiModel, HttpServletRequest request) {
    HttpSession session = request.getSession();
    Enterprise enterprise = (Enterprise) session.getAttribute("webenterprise");
    UserInfo userInfo = (UserInfo) session.getAttribute("webuserInfo");
    if (null == enterprise || null == userInfo) {
        uiModel.addAttribute("errorMsg", "登录失效");
        return "client/errorpage";
    }
    ExtraBill bill = extraBillService.selectByPrimaryKey(id);
    if (null == bill) {
        uiModel.addAttribute("errorMsg", "订单不存在");
        return "client/errorpage";
    }
    uiModel.addAttribute("bill", bill);
    if (!bill.getUniqueId().equals(userInfo.getId())) {
        uiModel.addAttribute("errorMsg", "您无权操作该订单");
        return "client/errorpage";
    }
    // 订单对应的产品信息
    ExtraProduct product = extraProductService.selectByPrimaryKey(bill.getExtraProduct());
    uiModel.addAttribute("product", product);
    // 订单对应的规格信息
    ExtraProductSpec productSpec = extraProductSpecService.selectByPrimaryKey(bill.getExtraProductSpec());
    uiModel.addAttribute("productSpec", productSpec);
    // 银行卡支付记录信息
    PayInfoExample payInfoex = new PayInfoExample();
    Map<Long, PayInfo> payinfoMap = sqlSession.selectMap("com.itrus.portal.db.PayInfoMapper.selectByExample", payInfoex, "id");
    uiModel.addAttribute("payinfomap", payinfoMap);
    // 获取订单在线支付方式
    if (null != bill.getOnPayInfo()) {
        // 第三方在线支付记录信息
        Map<Long, OnPayInfo> opiMap = sqlSession.selectMap("com.itrus.portal.db.OnPayInfoMapper.selectByExample", "id");
        uiModel.addAttribute("opiMap", opiMap);
        // 在线支付方式配置,目前有微信和支付宝两种
        Map<Long, OnlinePay> opMap = sqlSession.selectMap("com.itrus.portal.db.OnlinePayMapper.selectByExample", "id");
        uiModel.addAttribute("opMap", opMap);
    }
    // 电子发票信息
    if (null != bill.geteInvoice()) {
        Einvoice einvoice = sqlSession.selectOne("com.itrus.portal.db.EinvoiceMapper.selectByPrimaryKey", bill.geteInvoice());
        uiModel.addAttribute("einvoice", einvoice);
    }
    // 纸票模版
    Map<Long, Receipt> receiptmap = sqlSession.selectMap("com.itrus.portal.db.ReceiptMapper.selectByExample", null, "id");
    uiModel.addAttribute("receiptmap", receiptmap);
    // 电票开票模版
    Map<Long, Ereceipt> ereceiptmap = sqlSession.selectMap("com.itrus.portal.db.EreceiptMapper.selectByExample", null, "id");
    uiModel.addAttribute("ereceiptmap", ereceiptmap);
    return "client/shenhejujue";
}
Also used : Ereceipt(com.itrus.portal.db.Ereceipt) PayInfoExample(com.itrus.portal.db.PayInfoExample) Receipt(com.itrus.portal.db.Receipt) HttpSession(javax.servlet.http.HttpSession) ExtraBill(com.itrus.portal.db.ExtraBill) ExtraProductSpec(com.itrus.portal.db.ExtraProductSpec) UserInfo(com.itrus.portal.db.UserInfo) Einvoice(com.itrus.portal.db.Einvoice) ExtraProduct(com.itrus.portal.db.ExtraProduct) OnPayInfo(com.itrus.portal.db.OnPayInfo) PayInfo(com.itrus.portal.db.PayInfo) OnPayInfo(com.itrus.portal.db.OnPayInfo) Enterprise(com.itrus.portal.db.Enterprise) OnlinePay(com.itrus.portal.db.OnlinePay) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

OnPayInfo (com.itrus.portal.db.OnPayInfo)12 PayInfo (com.itrus.portal.db.PayInfo)12 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)12 Enterprise (com.itrus.portal.db.Enterprise)8 UserInfo (com.itrus.portal.db.UserInfo)8 HashMap (java.util.HashMap)8 Map (java.util.Map)8 DigitalCert (com.itrus.portal.db.DigitalCert)7 Product (com.itrus.portal.db.Product)7 HttpSession (javax.servlet.http.HttpSession)7 OnlinePay (com.itrus.portal.db.OnlinePay)6 PayInfoExample (com.itrus.portal.db.PayInfoExample)6 ProductSpec (com.itrus.portal.db.ProductSpec)6 ReviewLog (com.itrus.portal.db.ReviewLog)6 IOException (java.io.IOException)5 EncDecException (com.itrus.portal.exception.EncDecException)4 Bill (com.itrus.portal.db.Bill)3 Ereceipt (com.itrus.portal.db.Ereceipt)3 Receipt (com.itrus.portal.db.Receipt)3 UserCert (com.itrus.portal.db.UserCert)3