Search in sources :

Example 11 with ExtraProductSpec

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

the class ClientWebController method submitOrder.

// TODO 用户提交订单:确认订单页面,点击去支付
@RequestMapping("/submitOrder")
@ResponseBody
public Map<String, Object> submitOrder(@RequestParam(value = "projectId", required = true) Long projectId, @RequestParam(value = "productId", required = true) Long productId, @RequestParam(value = "productNum", required = true) Integer productNum, @RequestParam(value = "productSpecId", required = true) Long productSpecId, @ModelAttribute("enterprise") Enterprise enterprise, @ModelAttribute("userInfo") UserInfo userInfo, @ModelAttribute("einvoice") Einvoice einvoice, @ModelAttribute("businessLicense") BusinessLicense businessLicense, @ModelAttribute("orgCode") OrgCode orgCode, @ModelAttribute("taxregisterCert") TaxRegisterCert taxregisterCert, @ModelAttribute("agent") Agent agent, @ModelAttribute("openBankInfo") OpenBankInfo openBankInfo, @ModelAttribute("identityCard") IdentityCard identityCard, HttpServletRequest request) {
    Map<String, Object> retMap = new HashMap<String, Object>();
    // 0标识失败,1标识成功
    retMap.put("retCode", 0);
    HttpSession session = request.getSession();
    UserInfo webuserInfo = (UserInfo) session.getAttribute("webuserInfo");
    Enterprise webenterprise = (Enterprise) session.getAttribute("webenterprise");
    if (null == webuserInfo || null == webenterprise) {
        retMap.put("retMsg", "用户登录信息已失效,请重新登录");
        return retMap;
    }
    ExtraProduct product = extraProductService.selectByPrimaryKey(productId);
    if (null == product) {
        retMap.put("retMsg", "产品信息不存在,请重新选择产品");
        return retMap;
    }
    ExtraProductSpec productSpec = extraProductSpecService.selectByPrimaryKey(productSpecId);
    if (null == productSpec || productSpec.getIsValid().equals(false)) {
        retMap.put("retMsg", "规格信息不存在或已经失效,请重新选择规格");
        return retMap;
    }
    DefaultTransactionDefinition def = new DefaultTransactionDefinition();
    def.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);
    TransactionStatus status = transactionManager.getTransaction(def);
    try {
        // 保存发票信息(填写了发票信息才保存,未填写则不保存)
        if (StringUtils.isNotBlank(einvoice.getName()) && StringUtils.isNotBlank(einvoice.getIdNumber()) && null != einvoice.geteReiceipt())
            einvoice = EinvoiceService.saveEInvoice(webuserInfo.getId(), einvoice);
        // 计算订单价格
        Double billSum = null;
        billSum = productNum * productSpec.getPrice();
        // 生成订单
        ExtraBill bill = extraBillService.saveExtraBill(projectId, webuserInfo.getId(), webenterprise.getId(), productId, productSpecId, null != einvoice.getId() ? einvoice.getId() : null, productNum, billSum, ComNames.EXTRA_BILL_STATUS_1);
        // ""字符串判断,改为Null,避免覆盖数据库中的信息
        if (null != enterprise && StringUtils.isBlank(enterprise.getProvince())) {
            enterprise.setProvince(null);
        }
        if (null != enterprise && StringUtils.isBlank(enterprise.getCity())) {
            enterprise.setCity(null);
        }
        if (null != enterprise && StringUtils.isBlank(enterprise.getShortName())) {
            enterprise.setShortName(null);
        }
        // 更新用户信息和企业信息
        if (null != enterprise && null == enterprise.getId()) {
            enterprise.setId(webenterprise.getId());
        }
        if (null != userInfo && null == userInfo.getId()) {
            userInfo.setId(webuserInfo.getId());
        }
        enterprise = enterpriseService.updateByPrimaryKeySelective(enterprise);
        userInfo = userInfoService.updateByPrimaryKeySelective(userInfo);
        // 获取产品需要的附加信息项
        ExtraMessage extraMessage = extraMessageService.selectByPrimaryKey(product.getExtraMessage());
        // 是否有营业执照信息,默认false没有
        boolean hasBl = false;
        if (null != extraMessage) {
            // //企业信息 认证项(1.企业名称,2.统一社会信用代码/营业执照,3.组织机构代码,4.税务登记号)
            if (StringUtils.isNotBlank(extraMessage.getEnterpriseItems())) {
                if (StringUtils.isNotBlank(extraMessage.getEnterpriseItems())) {
                    if (extraMessage.getEnterpriseItems().contains("1")) {
                    }
                    if (extraMessage.getEnterpriseItems().contains("2") && !webenterprise.getEnterpriseNature().equals(3)) {
                        // 事业单位不填写营业执照
                        hasBl = true;
                        // 需要统一社会信用代码/营业执照实名认证项,但是页面没有传递过来的时候,用老的
                        if (null == businessLicense || !StringUtils.isNotBlank(businessLicense.getImgFile())) {
                            List<BusinessLicense> businessLicenses = businessService.getBusinessLicensesNews(webenterprise.getId());
                            if (null != businessLicenses && !businessLicenses.isEmpty()) {
                                businessLicense = businessLicenses.get(0);
                                businessLicense.setImgFile(null);
                            }
                        }
                        businessLicense = businessService.saveBusinessExtraBill(webenterprise.getId(), webenterprise.getEnterpriseSn(), bill.getId(), webuserInfo.getId(), businessLicense, ComNames.ITEM_STATUS_2, null);
                    }
                    if (extraMessage.getEnterpriseItems().contains("3")) {
                        // 需要统一组织机构代码认证项,但是页面没有传递过来的时候,用老的
                        if (!(hasBl && businessLicense.getBusinessType().equals(// 五证合一企业不用提交组织机构代码、税务登记信息
                        1))) {
                            if (null == orgCode || !StringUtils.isNotBlank(orgCode.getImgFile())) {
                                List<OrgCode> orgCodes = orgCodeService.getOrgCodesNews(webenterprise.getId());
                                if (null != orgCodes && !orgCodes.isEmpty()) {
                                    orgCode = orgCodes.get(0);
                                    orgCode.setImgFile(null);
                                }
                            }
                            orgCode = orgCodeService.saveOrgCodeExtraBill(webenterprise.getId(), webenterprise.getEnterpriseSn(), bill.getId(), webuserInfo.getId(), orgCode, ComNames.ITEM_STATUS_2, null);
                        }
                    }
                    if (extraMessage.getEnterpriseItems().contains("4")) {
                        if (!(hasBl && businessLicense.getBusinessType().equals(// 五证合一企业不用提交组织机构代码、税务登记信息
                        1))) {
                            // 保存税务登记证
                            if (// 事业单位不填写税务登记信息
                            !webenterprise.getEnterpriseNature().equals(3)) {
                                // 需要税务登记实名认证项,但是页面没有传递过来的时候,用老的
                                if (null == taxregisterCert || !StringUtils.isNotBlank(taxregisterCert.getImgFile())) {
                                    List<TaxRegisterCert> taxRegisterCerts = taxCertService.getTaxRegisterCertsNews(webenterprise.getId());
                                    if (null != taxRegisterCerts && !taxRegisterCerts.isEmpty()) {
                                        taxregisterCert = taxRegisterCerts.get(0);
                                        taxregisterCert.setImgFile(null);
                                    }
                                }
                                taxregisterCert = taxCertService.saveTaxCertExtraBill(webenterprise.getId(), webenterprise.getEnterpriseSn(), bill.getId(), webuserInfo.getId(), taxregisterCert, ComNames.ITEM_STATUS_2, null);
                            }
                        }
                    }
                }
            }
            // field string --fieldName agentItems
            if (StringUtils.isNotBlank(extraMessage.getAgentItems())) {
                if (null == agent || StringUtils.isBlank(agent.getFrontImg())) {
                    List<Agent> agents = agentService.getAgentsNews(webenterprise.getId());
                    if (null != agents && !agents.isEmpty()) {
                        agent = agents.get(0);
                        agent.setFrontImg(null);
                        agent.setBackImg(null);
                    }
                }
                agent = agentService.saveAgentExtraBill(webenterprise.getId(), webenterprise.getEnterpriseSn(), bill.getId(), webuserInfo.getId(), agent, ComNames.ITEM_STATUS_2, null);
            }
            // field string --fieldName bankItems
            if (StringUtils.isNotBlank(extraMessage.getBankItems())) {
                if (null == openBankInfo || StringUtils.isBlank(openBankInfo.getBankNumber())) {
                    List<OpenBankInfo> openBankInfos = openBankInfoService.getOpenBankInfosNews(webenterprise.getId());
                    if (null != openBankInfos && !openBankInfos.isEmpty()) {
                        openBankInfo = openBankInfos.get(0);
                    }
                }
                openBankInfo = openBankInfoService.saveOpenBankInfoExtraBill(webenterprise.getId(), bill.getId(), webuserInfo.getId(), openBankInfo, ComNames.ITEM_STATUS_2, null);
            }
            // field string  --fieldName identityCardItems
            if (StringUtils.isNotBlank(extraMessage.getIdentityCardItems())) {
                if (null == identityCard || StringUtils.isBlank(identityCard.getFrontImg())) {
                    List<IdentityCard> identityCards = identityCardService.getIdentityCardsNews(webenterprise.getId());
                    if (null != identityCards && !identityCards.isEmpty()) {
                        identityCard = identityCards.get(0);
                        identityCard.setFrontImg(null);
                        identityCard.setBackImg(null);
                    }
                }
                identityCard = identityCardService.saveIdentityCardExtraBill(webenterprise.getId(), webenterprise.getEnterpriseSn(), bill.getId(), webuserInfo.getId(), identityCard, ComNames.ITEM_STATUS_2, null);
            }
        }
        transactionManager.commit(status);
        retMap.put("retCode", 1);
        retMap.put("billId", bill.getId());
        // 更新session用户和企业信息
        webenterprise = enterpriseService.getEnterpriseById(webenterprise.getId());
        webuserInfo = userInfoService.getUserInfoById(webuserInfo.getId());
        session.setAttribute("webenterprise", webenterprise);
        session.setAttribute("webuserInfo", webuserInfo);
        // 记录日志
        UserLog userlog = new UserLog();
        userlog.setProject(projectId);
        userlog.setType("购买增值产品");
        userlog.setInfo(webuserInfo.getmPhone() + "购买了" + product.getAppName());
        userlog.setHostId("未知");
        userlog.setSn(null == webuserInfo.getUniqueId() ? null : webuserInfo.getUniqueId());
        LogUtil.userlog(sqlSession, userlog);
        return retMap;
    } catch (UserInfoServiceException e) {
        if (!status.isCompleted()) {
            transactionManager.rollback(status);
        }
        retMap.put("retMsg", e.getMessage());
        return retMap;
    } catch (Exception e) {
        if (!status.isCompleted()) {
            transactionManager.rollback(status);
        }
        UserLog userlog = new UserLog();
        userlog.setProject(projectId);
        userlog.setType("购买增值产品");
        userlog.setInfo("url:submitOrder,详细错误:" + e.getMessage());
        userlog.setHostId("未知");
        userlog.setSn(null == webuserInfo.getUniqueId() ? null : webuserInfo.getUniqueId());
        LogUtil.userlog(sqlSession, userlog);
        retMap.put("retMsg", "服务端出现未知错误,请联系管理员");
        return retMap;
    } finally {
        if (!status.isCompleted()) {
            transactionManager.rollback(status);
        }
    }
}
Also used : DefaultTransactionDefinition(org.springframework.transaction.support.DefaultTransactionDefinition) HashMap(java.util.HashMap) ExtraBill(com.itrus.portal.db.ExtraBill) TransactionStatus(org.springframework.transaction.TransactionStatus) UserInfo(com.itrus.portal.db.UserInfo) OpenBankInfo(com.itrus.portal.db.OpenBankInfo) IdentityCard(com.itrus.portal.db.IdentityCard) Agent(com.itrus.portal.db.Agent) HttpSession(javax.servlet.http.HttpSession) ExtraProductSpec(com.itrus.portal.db.ExtraProductSpec) UserLog(com.itrus.portal.db.UserLog) UserInfoServiceException(com.itrus.portal.exception.UserInfoServiceException) IOException(java.io.IOException) UserInfoServiceException(com.itrus.portal.exception.UserInfoServiceException) ExtraProduct(com.itrus.portal.db.ExtraProduct) OrgCode(com.itrus.portal.db.OrgCode) BusinessLicense(com.itrus.portal.db.BusinessLicense) Enterprise(com.itrus.portal.db.Enterprise) UserinfoEnterprise(com.itrus.portal.db.UserinfoEnterprise) ExtraMessage(com.itrus.portal.db.ExtraMessage) TaxRegisterCert(com.itrus.portal.db.TaxRegisterCert) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 12 with ExtraProductSpec

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

the class ExtraBillWebController method billList.

/**
 * 订单列表
 *
 * @param billStatus
 *            0未完成订单,1已完成订单
 * @param request
 * @param uiModel
 * @return
 * @throws Exception
 */
@RequestMapping(produces = "text/html")
public String billList(@RequestParam(value = "billStatus", required = false) Integer billStatus, @RequestParam(value = "page", required = false) Integer page, @RequestParam(value = "size", required = false) Integer size, HttpServletRequest request, Model uiModel) throws Exception {
    HttpSession session = request.getSession();
    Enterprise enterprise = (Enterprise) session.getAttribute("webenterprise");
    UserInfo userInfo = (UserInfo) session.getAttribute("webuserInfo");
    if (userInfo != null && enterprise == null) {
        // 登录未获取到企业信息,跳转到选择企业页面
        return "redirect:/userInfoWeb/choiceEnterprise";
    }
    uiModel.addAttribute("billStatus", billStatus);
    if (page == null || page < 1) {
        page = 1;
    }
    if (size == null || size < 1) {
        size = 5;
    }
    // 获取仅用户授权产品,不返回该类型产品的订单
    List<Long> productOpenTypes = extraProductService.getProductOpenType(ComNames.PRODUCT_OPEN_TYPE_1);
    ExtraBillExample billExampl0 = new ExtraBillExample();
    ExtraBillExample.Criteria criteria0 = billExampl0.or();
    // 查询当前用户当前企业的订单
    // 当前用户
    criteria0.andUniqueIdEqualTo(userInfo.getId());
    // 当前企业
    criteria0.andEnterpriseEqualTo(enterprise.getId());
    criteria0.andIsDeleteNotEqualTo(true);
    ExtraBillExample billExampl1 = new ExtraBillExample();
    ExtraBillExample.Criteria criteria1 = billExampl1.or();
    // 查询当前用户当前企业的订单
    // 当前用户
    criteria1.andUniqueIdEqualTo(userInfo.getId());
    // 当前企业
    criteria1.andEnterpriseEqualTo(enterprise.getId());
    criteria1.andIsDeleteNotEqualTo(true);
    if (null != productOpenTypes && !productOpenTypes.isEmpty()) {
        criteria0.andExtraProductNotIn(productOpenTypes);
        criteria1.andExtraProductNotIn(productOpenTypes);
    }
    // if (null == billStatus || 0 == billStatus) {
    // // 未完成订单:订单状态不为7
    // criteria.andBillStatusNotEqualTo(ComNames.EXTRA_BILL_STATUS_7);
    // criteria.andIsDeleteEqualTo(false);
    // } else if (1 == billStatus) {
    // criteria.andBillStatusEqualTo(ComNames.EXTRA_BILL_STATUS_7);// 订单状态为已完成
    // }
    // 未完成订单:订单状态不为7
    criteria0.andBillStatusNotEqualTo(ComNames.EXTRA_BILL_STATUS_7);
    criteria0.andIsDeleteEqualTo(false);
    // 订单状态为已完成
    criteria1.andBillStatusEqualTo(ComNames.EXTRA_BILL_STATUS_7);
    // Integer count = extraBillService.countByExample(billExampl);
    // if (page > 1 && size * (page - 1) >= count) {
    // page = (count + size - 1) / size;
    // }
    // uiModel.addAttribute("count", count);
    // uiModel.addAttribute("pages", (count + size - 1) / size);
    // uiModel.addAttribute("page", page);
    // uiModel.addAttribute("size", size);
    // Integer offset = size * (page - 1);
    // 
    // billExampl.setOffset(offset);
    // billExampl.setLimit(size);
    billExampl0.setOrderByClause("create_time desc");
    List<ExtraBill> billList0 = extraBillService.selectByExample(billExampl0);
    uiModel.addAttribute("billList0", billList0);
    // uiModel.addAttribute("itemcount", billList.size());
    // 获取订单对应的产品规格
    Map<Long, ExtraProductSpec> productSpecMap0 = extraProductSpecService.getProductSpec(billList0);
    uiModel.addAttribute("productSpecMap0", productSpecMap0);
    List<ExtraBill> billList1 = extraBillService.selectByExample(billExampl1);
    uiModel.addAttribute("billList1", billList1);
    // uiModel.addAttribute("itemcount", billList.size());
    // 获取订单对应的产品规格
    Map<Long, ExtraProductSpec> productSpecMap1 = extraProductSpecService.getProductSpec(billList1);
    uiModel.addAttribute("productSpecMap1", productSpecMap1);
    // 增值产品信息:
    Map<Long, ExtraProduct> productMap = sqlSession.selectMap("com.itrus.portal.db.ExtraProductMapper.selectByExample", "id");
    uiModel.addAttribute("productMap", productMap);
    // 返回订单列表
    return "client/dingdanliebiao";
}
Also used : HttpSession(javax.servlet.http.HttpSession) ExtraBill(com.itrus.portal.db.ExtraBill) ExtraProductSpec(com.itrus.portal.db.ExtraProductSpec) UserInfo(com.itrus.portal.db.UserInfo) ExtraBillExample(com.itrus.portal.db.ExtraBillExample) ExtraProduct(com.itrus.portal.db.ExtraProduct) Enterprise(com.itrus.portal.db.Enterprise) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 13 with ExtraProductSpec

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

Example 14 with ExtraProductSpec

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

the class ExtraBillReceiptController method show.

// 显示详情
@RequestMapping(value = "/{id}", produces = "text/html")
public String show(@PathVariable("id") Long id, Model uiModel) {
    // 管理员项目权限
    Long[] projectsOfAdmin = getProjectLongIdsOfAdmin();
    List<Long> projectsOfAdminList = Arrays.asList(projectsOfAdmin);
    ExtraBillExample billExample = new ExtraBillExample();
    ExtraBillExample.Criteria criteria = billExample.or();
    criteria.andIdEqualTo(id);
    criteria.andProjectIn(projectsOfAdminList);
    ExtraBill bill = sqlSession.selectOne("com.itrus.portal.db.ExtraBillMapper.selectByExample", billExample);
    if (null == bill) {
        uiModel.addAttribute("errorMsg", "未找到该订单");
        return "status403";
    }
    uiModel.addAttribute("bill", bill);
    // 项目
    Project project = sqlSession.selectOne("com.itrus.portal.db.ProjectMapper.selectByPrimaryKey", bill.getProject());
    uiModel.addAttribute("project", project);
    // 企业
    Enterprise enterprise = sqlSession.selectOne("com.itrus.portal.db.EnterpriseMapper.selectByPrimaryKey", bill.getEnterprise());
    uiModel.addAttribute("enterprise", enterprise);
    // 产品
    ExtraProduct product = sqlSession.selectOne("com.itrus.portal.db.ExtraProductMapper.selectByPrimaryKey", bill.getExtraProduct());
    uiModel.addAttribute("product", product);
    // 规格
    ExtraProductSpec productSpec = sqlSession.selectOne("com.itrus.portal.db.ExtraProductSpecMapper.selectByPrimaryKey", bill.getExtraProductSpec());
    uiModel.addAttribute("productSpec", productSpec);
    // 服务商
    ServiceProvider serviceProvider = serviceProviderService.selectByPrimaryKey(product.getServiceProvider());
    uiModel.addAttribute("serviceProvider", serviceProvider);
    // 用户
    UserInfo userInfo = sqlSession.selectOne("com.itrus.portal.db.UserInfoMapper.selectByPrimaryKey", bill.getUniqueId());
    uiModel.addAttribute("userInfo", userInfo);
    // 第三方支付信息
    OnPayInfo onPayInfo = sqlSession.selectOne("com.itrus.portal.db.OnPayInfoMapper.selectByPrimaryKey", bill.getOnPayInfo());
    uiModel.addAttribute("onPayInfo", onPayInfo);
    // 电子发票
    Einvoice einvoice = sqlSession.selectOne("com.itrus.portal.db.EinvoiceMapper.selectByPrimaryKey", bill.geteInvoice());
    uiModel.addAttribute("einvoice", einvoice);
    if (einvoice != null && einvoice.geteReiceipt() != null) {
        // 电子发票类型
        Ereceipt ereceipt = sqlSession.selectOne("com.itrus.portal.db.EreceiptMapper.selectByPrimaryKey", einvoice.geteReiceipt());
        uiModel.addAttribute("ereceipt", ereceipt);
    }
    // 其他附加信息
    // 营业执照
    BusinessLicense businessLicense = businessService.getBusinessByExtraBillId(id, null);
    uiModel.addAttribute("businessLicense", businessLicense);
    // 税务登记
    TaxRegisterCert taxRegisterCert = taxCertService.getTaxRegisterCertByExtraBillId(id, null);
    uiModel.addAttribute("taxRegisterCert", taxRegisterCert);
    // 组织机构代码
    OrgCode orgCode = orgCodeService.getOrgCodeByExtraBillId(id, null);
    uiModel.addAttribute("orgCode", orgCode);
    // 代理人
    Agent agent = agentService.getAgentByExtraBillId(id, null);
    uiModel.addAttribute("agent", agent);
    // 开户行信息
    OpenBankInfo openBankInfo = openBankInfoService.getOpenBankInfoByExtraBillId(id, null);
    uiModel.addAttribute("openBankInfo", openBankInfo);
    // 法人信息
    IdentityCard identityCard = identityCardService.getIdentityCardByExtraBillId(id, null);
    uiModel.addAttribute("identityCard", identityCard);
    // TODO 还需要补充订单对应的附加信息和第三方回调信息
    return "extrabillreceipt/show";
}
Also used : Ereceipt(com.itrus.portal.db.Ereceipt) Agent(com.itrus.portal.db.Agent) ExtraBill(com.itrus.portal.db.ExtraBill) ExtraProductSpec(com.itrus.portal.db.ExtraProductSpec) UserInfo(com.itrus.portal.db.UserInfo) Einvoice(com.itrus.portal.db.Einvoice) ExtraBillExample(com.itrus.portal.db.ExtraBillExample) Project(com.itrus.portal.db.Project) ExtraProduct(com.itrus.portal.db.ExtraProduct) OrgCode(com.itrus.portal.db.OrgCode) BusinessLicense(com.itrus.portal.db.BusinessLicense) OnPayInfo(com.itrus.portal.db.OnPayInfo) OpenBankInfo(com.itrus.portal.db.OpenBankInfo) ServiceProvider(com.itrus.portal.db.ServiceProvider) Enterprise(com.itrus.portal.db.Enterprise) TaxRegisterCert(com.itrus.portal.db.TaxRegisterCert) IdentityCard(com.itrus.portal.db.IdentityCard) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 15 with ExtraProductSpec

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

the class ExtraBillReviewController method show.

// 显示详情
@RequestMapping(value = "/{id}", produces = "text/html")
public String show(@PathVariable("id") Long id, Model uiModel) {
    // 管理员项目权限
    Long[] projectsOfAdmin = getProjectLongIdsOfAdmin();
    List<Long> projectsOfAdminList = Arrays.asList(projectsOfAdmin);
    ExtraBillExample billExample = new ExtraBillExample();
    ExtraBillExample.Criteria criteria = billExample.or();
    criteria.andIdEqualTo(id);
    criteria.andProjectIn(projectsOfAdminList);
    ExtraBill bill = sqlSession.selectOne("com.itrus.portal.db.ExtraBillMapper.selectByExample", billExample);
    if (null == bill) {
        uiModel.addAttribute("errorMsg", "未找到该订单");
        return "status403";
    }
    uiModel.addAttribute("bill", bill);
    // 项目
    Project project = sqlSession.selectOne("com.itrus.portal.db.ProjectMapper.selectByPrimaryKey", bill.getProject());
    uiModel.addAttribute("project", project);
    // 企业
    Enterprise enterprise = sqlSession.selectOne("com.itrus.portal.db.EnterpriseMapper.selectByPrimaryKey", bill.getEnterprise());
    uiModel.addAttribute("enterprise", enterprise);
    // 产品
    ExtraProduct product = sqlSession.selectOne("com.itrus.portal.db.ExtraProductMapper.selectByPrimaryKey", bill.getExtraProduct());
    uiModel.addAttribute("product", product);
    // 规格
    ExtraProductSpec productSpec = sqlSession.selectOne("com.itrus.portal.db.ExtraProductSpecMapper.selectByPrimaryKey", bill.getExtraProductSpec());
    uiModel.addAttribute("productSpec", productSpec);
    // 服务商
    ServiceProvider serviceProvider = serviceProviderService.selectByPrimaryKey(product.getServiceProvider());
    uiModel.addAttribute("serviceProvider", serviceProvider);
    // 用户
    UserInfo userInfo = sqlSession.selectOne("com.itrus.portal.db.UserInfoMapper.selectByPrimaryKey", bill.getUniqueId());
    uiModel.addAttribute("userInfo", userInfo);
    // 第三方支付信息
    OnPayInfo onPayInfo = sqlSession.selectOne("com.itrus.portal.db.OnPayInfoMapper.selectByPrimaryKey", bill.getOnPayInfo());
    uiModel.addAttribute("onPayInfo", onPayInfo);
    // 电子发票
    Einvoice einvoice = sqlSession.selectOne("com.itrus.portal.db.EinvoiceMapper.selectByPrimaryKey", bill.geteInvoice());
    uiModel.addAttribute("einvoice", einvoice);
    // 其他附加信息
    // 营业执照
    BusinessLicense businessLicense = businessService.getBusinessByExtraBillId(id, null);
    uiModel.addAttribute("businessLicense", businessLicense);
    // 税务登记
    TaxRegisterCert taxRegisterCert = taxCertService.getTaxRegisterCertByExtraBillId(id, null);
    uiModel.addAttribute("taxRegisterCert", taxRegisterCert);
    // 组织机构代码
    OrgCode orgCode = orgCodeService.getOrgCodeByExtraBillId(id, null);
    uiModel.addAttribute("orgCode", orgCode);
    // 代理人
    Agent agent = agentService.getAgentByExtraBillId(id, null);
    uiModel.addAttribute("agent", agent);
    // 开户行信息
    OpenBankInfo openBankInfo = openBankInfoService.getOpenBankInfoByExtraBillId(id, null);
    uiModel.addAttribute("openBankInfo", openBankInfo);
    // 法人信息
    IdentityCard identityCard = identityCardService.getIdentityCardByExtraBillId(id, null);
    uiModel.addAttribute("identityCard", identityCard);
    // TODO 还需要补充订单对应的附加信息和第三方回调信息
    return "extrabillreview/show";
}
Also used : Agent(com.itrus.portal.db.Agent) ExtraBill(com.itrus.portal.db.ExtraBill) ExtraProductSpec(com.itrus.portal.db.ExtraProductSpec) UserInfo(com.itrus.portal.db.UserInfo) Einvoice(com.itrus.portal.db.Einvoice) ExtraBillExample(com.itrus.portal.db.ExtraBillExample) Project(com.itrus.portal.db.Project) ExtraProduct(com.itrus.portal.db.ExtraProduct) OrgCode(com.itrus.portal.db.OrgCode) BusinessLicense(com.itrus.portal.db.BusinessLicense) OnPayInfo(com.itrus.portal.db.OnPayInfo) OpenBankInfo(com.itrus.portal.db.OpenBankInfo) ServiceProvider(com.itrus.portal.db.ServiceProvider) Enterprise(com.itrus.portal.db.Enterprise) TaxRegisterCert(com.itrus.portal.db.TaxRegisterCert) IdentityCard(com.itrus.portal.db.IdentityCard) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

ExtraProductSpec (com.itrus.portal.db.ExtraProductSpec)21 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)15 ExtraProduct (com.itrus.portal.db.ExtraProduct)14 Enterprise (com.itrus.portal.db.Enterprise)11 ExtraBill (com.itrus.portal.db.ExtraBill)11 UserInfo (com.itrus.portal.db.UserInfo)11 ServiceProvider (com.itrus.portal.db.ServiceProvider)9 Ereceipt (com.itrus.portal.db.Ereceipt)8 OpenBankInfo (com.itrus.portal.db.OpenBankInfo)8 Agent (com.itrus.portal.db.Agent)7 BusinessLicense (com.itrus.portal.db.BusinessLicense)7 IdentityCard (com.itrus.portal.db.IdentityCard)7 OnlinePay (com.itrus.portal.db.OnlinePay)7 OrgCode (com.itrus.portal.db.OrgCode)7 TaxRegisterCert (com.itrus.portal.db.TaxRegisterCert)7 HttpSession (javax.servlet.http.HttpSession)7 Einvoice (com.itrus.portal.db.Einvoice)6 OnPayInfo (com.itrus.portal.db.OnPayInfo)6 ExtraBillExample (com.itrus.portal.db.ExtraBillExample)5 ExtraMessage (com.itrus.portal.db.ExtraMessage)5