Search in sources :

Example 6 with MakeSealConfig

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

the class MakeSealConfigController method show.

// 显示详情
@RequestMapping(value = "/{id}", produces = "text/html")
public String show(@PathVariable("id") Long id, Model uiModel) throws Exception {
    MakeSealConfig makeSealConfig = sqlSession.selectOne("com.itrus.portal.db.MakeSealConfigMapper.selectByPrimaryKey", id);
    uiModel.addAttribute("makesealconfig", makeSealConfig);
    return "makesealconfig/show";
}
Also used : MakeSealConfig(com.itrus.portal.db.MakeSealConfig) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 7 with MakeSealConfig

use of com.itrus.portal.db.MakeSealConfig 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 8 with MakeSealConfig

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

the class MakeCertController method makeSeal.

/**
 * 获取签章模版
 *
 * @param billId
 * @return
 * @throws Exception
 * @throws EncDecException
 */
@RequestMapping(value = "/makeSeal", method = RequestMethod.POST)
@ResponseBody
public Map<String, Object> makeSeal(@RequestParam(value = "billId", required = true) Long billId, @RequestParam(value = "productId", required = false) Long productId, HttpServletRequest request, HttpServletResponse response) throws EncDecException, Exception {
    Map<String, Object> map = new HashMap<String, Object>();
    map.put("retCode", 0);
    // 获取签章模版
    Bill bill = sqlSession.selectOne("com.itrus.portal.db.BillMapper.selectByPrimaryKey", billId);
    // 查询项目产品
    Product product = null;
    // 如为组合产品productId不为空
    if (null == productId) {
        product = sqlSession.selectOne("com.itrus.portal.db.ProductMapper.selectByPrimaryKey", bill.getProduct());
    } else {
        product = sqlSession.selectOne("com.itrus.portal.db.ProductMapper.selectByPrimaryKey", productId);
    }
    if (null == product.getMakeSealServer() || product.getMakeSealServer() <= 0) {
        map.put("retMsg", "该产品未配置签章服务");
        return map;
    }
    MakeSealServer makeSealServer = sqlSession.selectOne("com.itrus.portal.db.MakeSealServerMapper.selectByPrimaryKey", product.getMakeSealServer());
    // 签章服务配置
    List<MakeSealConfig> makeSealConfigs = sqlSession.selectList("com.itrus.portal.db.MakeSealConfigMapper.selectByExample");
    if (makeSealConfigs.isEmpty()) {
        map.put("retMsg", "没有找到签章服务配置");
        return map;
    }
    /**
     * 增加百润和以前的点聚
     */
    if (makeSealServer.getFirm().contains("点聚")) {
        // 新加if
        if (makeSealConfigs.get(0).getName().equals(makeSealServer.getFirm())) {
            MakeSealConfig makeSealConfig = makeSealConfigs.get(0);
            makeSealConfig.setAddressKey(AESencrp.decrypt(makeSealConfig.getAddressKey(), dbEncKey));
            map.put("retCode", 1);
            map.put("makeSealConfig", makeSealConfig);
            // 替换-印章名称
            if (StringUtils.isNotBlank(makeSealServer.getSealName())) {
                UIDInfoUtils uidutils = new UIDInfoUtils();
                uidutils.initService(businessService, orgCodeService, taxCertService, identityCardService, userInfoService, enterpriseService);
                makeSealServer.setSealName(uidutils.getUidInfo(billId, makeSealServer.getSealName()));
            }
        } else {
            MakeSealConfig makeSealConfig = makeSealConfigs.get(1);
            makeSealConfig.setAddressKey(AESencrp.decrypt(makeSealConfig.getAddressKey(), dbEncKey));
            map.put("retCode", 1);
            map.put("makeSealConfig", makeSealConfig);
            // 替换-印章名称
            if (StringUtils.isNotBlank(makeSealServer.getSealName())) {
                UIDInfoUtils uidutils = new UIDInfoUtils();
                uidutils.initService(businessService, orgCodeService, taxCertService, identityCardService, userInfoService, enterpriseService);
                makeSealServer.setSealName(uidutils.getUidInfo(billId, makeSealServer.getSealName()));
            }
        }
    }
    // 新加百润
    if (makeSealServer.getFirm().contains("百润")) {
        // 第一条是点聚,第二条是百润
        if (makeSealConfigs.get(0).getName().equals(makeSealServer.getFirm())) {
            MakeSealConfig makeSealConfig = makeSealConfigs.get(0);
            makeSealConfig.setAddressKey(AESencrp.decrypt(makeSealConfig.getAddressKey(), dbEncKey));
            map.put("retCode", 1);
            map.put("makeSealConfig", makeSealConfig);
            // 替换-印章名称
            if (StringUtils.isNotBlank(makeSealServer.getSealName())) {
                UIDInfoUtils uidutils = new UIDInfoUtils();
                uidutils.initService(businessService, orgCodeService, taxCertService, identityCardService, userInfoService, enterpriseService);
                makeSealServer.setSealName(uidutils.getUidInfo(billId, makeSealServer.getSealName()));
            }
        } else {
            MakeSealConfig makeSealConfig = makeSealConfigs.get(1);
            makeSealConfig.setAddressKey(AESencrp.decrypt(makeSealConfig.getAddressKey(), dbEncKey));
            map.put("retCode", 1);
            map.put("makeSealConfig", makeSealConfig);
            // 替换-印章名称
            if (StringUtils.isNotBlank(makeSealServer.getSealName())) {
                UIDInfoUtils uidutils = new UIDInfoUtils();
                uidutils.initService(businessService, orgCodeService, taxCertService, identityCardService, userInfoService, enterpriseService);
                makeSealServer.setSealName(uidutils.getUidInfo(billId, makeSealServer.getSealName()));
            }
        }
    }
    map.put("makeSealServer", makeSealServer);
    return map;
}
Also used : UIDInfoUtils(com.itrus.portal.utils.UIDInfoUtils) MakeSealServer(com.itrus.portal.db.MakeSealServer) MakeSealConfig(com.itrus.portal.db.MakeSealConfig) HashMap(java.util.HashMap) Bill(com.itrus.portal.db.Bill) Product(com.itrus.portal.db.Product) JSONObject(com.alibaba.fastjson.JSONObject) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 9 with MakeSealConfig

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

the class MakeSealConfigController method updateForm.

// 返回修改页面
@RequestMapping(value = "/{id}", params = "form", produces = "text/html")
public String updateForm(@PathVariable("id") Long id, Model uiModel) throws Exception {
    MakeSealConfig makeSealConfig = sqlSession.selectOne("com.itrus.portal.db.MakeSealConfigMapper.selectByPrimaryKey", id);
    uiModel.addAttribute("makesealconfig", makeSealConfig);
    return "makesealconfig/update";
}
Also used : MakeSealConfig(com.itrus.portal.db.MakeSealConfig) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 10 with MakeSealConfig

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

the class MakeSealServerController method updateForm.

// 修改页面
@RequestMapping(value = "/{id}", params = "form", produces = "text/html")
public String updateForm(@PathVariable("id") Long id, Model uiModel) {
    MakeSealServer makeSealServer = makeSealServerService.selectMakeSealServer(id);
    uiModel.addAttribute("makeSealServer", makeSealServer);
    List<MakeSealConfig> makeSealConfigs = new ArrayList<MakeSealConfig>();
    makeSealConfigs = sqlSession.selectList("com.itrus.portal.db.MakeSealConfigMapper.selectByExample", null);
    uiModel.addAttribute("makeSealConfigs", makeSealConfigs);
    // if(makeSealServer.getFirm().contains("点聚")){
    return "makesealserver/update";
/*}else{
			return "makesealserver/update2";
		}*/
}
Also used : MakeSealServer(com.itrus.portal.db.MakeSealServer) MakeSealConfig(com.itrus.portal.db.MakeSealConfig) ArrayList(java.util.ArrayList) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

MakeSealConfig (com.itrus.portal.db.MakeSealConfig)10 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)9 Product (com.itrus.portal.db.Product)6 MakeSealServer (com.itrus.portal.db.MakeSealServer)5 EncDecException (com.itrus.portal.exception.EncDecException)5 HashMap (java.util.HashMap)5 UIDInfoUtils (com.itrus.portal.utils.UIDInfoUtils)4 JSONObject (com.alibaba.fastjson.JSONObject)3 Bill (com.itrus.portal.db.Bill)3 CertBuf (com.itrus.portal.db.CertBuf)3 DigitalCert (com.itrus.portal.db.DigitalCert)3 ProductSpec (com.itrus.portal.db.ProductSpec)3 IOException (java.io.IOException)3 Map (java.util.Map)3 RaServiceUnavailable_Exception (cn.topca.tca.ra.service.RaServiceUnavailable_Exception)2 Enterprise (com.itrus.portal.db.Enterprise)2 OnPayInfo (com.itrus.portal.db.OnPayInfo)2 OnlinePay (com.itrus.portal.db.OnlinePay)2 PayInfo (com.itrus.portal.db.PayInfo)2 PayInfoExample (com.itrus.portal.db.PayInfoExample)2