Search in sources :

Example 6 with ReviewLog

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

the class BillWebController method reNewCertConfirm.

// 订单详情,待更新确认
@RequestMapping(value = "/reNewCertConfirm/{id}", produces = "text/html")
public String reNewCertConfirm(@PathVariable("id") Long id, 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";
    }
    // 审核记录
    ReviewLog reviewLog = reviewLogService.getReviewLog(id);
    if (reviewLog != null) {
        uiModel.addAttribute("reviewLog", reviewLog);
    }
    Map param = new HashMap();
    // 设置查询条件,选择属于当前用户,当前企业的订单
    param.put("id", id);
    // param.put("userinfoid", userInfo.getId());
    // param.put("enterpriseid", enterprise.getId());
    List<Map> billAll = sqlSession.selectList("com.itrus.portal.db.BillMapper.selectProductBillCertById", param);
    log.error("--------获取订单数量-------" + billAll.size() + "*****获取订单信息***" + billAll);
    log.error("------获取订单id--------" + billAll.get(0).get("id"));
    log.error("========获取订单编号=========" + billAll.get(0).get("bill_id"));
    if (0 == billAll.size()) {
        return "redirect:/userInfoWeb/denglu.html";
    }
    uiModel.addAttribute("bills", billAll.get(0));
    // 获取数字证书
    Product product = productService.getProduct((Long) billAll.get(0).get("product"));
    log.error("****获取产品id*****" + product.getId());
    DigitalCert digitalCert = digitalCertService.getDigitalCert(product.getCert());
    // 获取订单在线支付方式
    if (billAll.get(0).get("on_pay_info") != null) {
        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);
    }
    PayInfoExample payInfoex = new PayInfoExample();
    Map<Long, PayInfo> payinfoMap = sqlSession.selectMap("com.itrus.portal.db.PayInfoMapper.selectByExample", payInfoex, "id");
    uiModel.addAttribute("payinfomap", payinfoMap);
    // 获取产品规格
    ProductSpec productSpec = null;
    if (null != billAll.get(0).get("product_spec") && !"0".equals(billAll.get(0).get("product_spec"))) {
        productSpec = productSpecService.getProductSpec((Long) billAll.get(0).get("product_spec"));
    }
    uiModel.addAttribute("productSpec", productSpec);
    uiModel.addAttribute("digitalCert", digitalCert);
    // 返回订单对应的老证书的base64
    CertBuf certBuf = sqlSession.selectOne("com.itrus.portal.db.CertBufMapper.selectCertBufByBillId", id);
    if (null != certBuf) {
        uiModel.addAttribute("oldCertB64", certBuf.getCertBuf().replaceAll("\n", ""));
    }
    log.error("*********签章服务******" + product.getMakeSealServer());
    // 判断是否有签章服务,有则显示授权
    if (null != product.getMakeSealServer()) {
        uiModel.addAttribute("makesealserver", product.getMakeSealServer());
        uiModel.addAttribute("billId", billAll.get(0).get("id"));
        // 签章服务配置
        List<MakeSealConfig> makeSealConfigs = sqlSession.selectList("com.itrus.portal.db.MakeSealConfigMapper.selectByExample");
        if (!makeSealConfigs.isEmpty()) {
            MakeSealConfig makeSealConfig = makeSealConfigs.get(0);
            try {
                makeSealConfig.setAddressKey(AESencrp.decrypt(makeSealConfig.getAddressKey(), dbEncKey));
            } catch (EncDecException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            } catch (Exception e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
            uiModel.addAttribute("makeSealConfig", makeSealConfig);
        }
    }
    return "ixinweb/dingdanxiangqing_gengxinqueren";
}
Also used : PayInfoExample(com.itrus.portal.db.PayInfoExample) HashMap(java.util.HashMap) HttpSession(javax.servlet.http.HttpSession) Product(com.itrus.portal.db.Product) EncDecException(com.itrus.portal.exception.EncDecException) UserInfo(com.itrus.portal.db.UserInfo) ProductSpec(com.itrus.portal.db.ProductSpec) IOException(java.io.IOException) JsonGenerationException(org.codehaus.jackson.JsonGenerationException) EncDecException(com.itrus.portal.exception.EncDecException) JsonMappingException(org.codehaus.jackson.map.JsonMappingException) UserInfoServiceException(com.itrus.portal.exception.UserInfoServiceException) DigitalCert(com.itrus.portal.db.DigitalCert) MakeSealConfig(com.itrus.portal.db.MakeSealConfig) PayInfo(com.itrus.portal.db.PayInfo) OnPayInfo(com.itrus.portal.db.OnPayInfo) OnPayInfo(com.itrus.portal.db.OnPayInfo) Enterprise(com.itrus.portal.db.Enterprise) ReviewLog(com.itrus.portal.db.ReviewLog) CertBuf(com.itrus.portal.db.CertBuf) Map(java.util.Map) HashMap(java.util.HashMap) OnlinePay(com.itrus.portal.db.OnlinePay) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 7 with ReviewLog

use of com.itrus.portal.db.ReviewLog 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)

Aggregations

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