Search in sources :

Example 16 with OpenBankInfo

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

Example 17 with OpenBankInfo

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

the class OpenBankInfoServiceImpl method saveOpenBankInfoExtraBill.

/**
 * 增值订单保存开户行信息
 * @param enterpriseId
 * @param enterpriseSn
 * @param billId
 * @param userInfoId
 * @param openBankInfo
 * @param itemStatus
 * @param old
 * @return
 * @throws Exception
 */
public OpenBankInfo saveOpenBankInfoExtraBill(Long enterpriseId, Long billId, Long userInfoId, OpenBankInfo openBankInfo, Integer itemStatus, OpenBankInfo old) throws Exception {
    if (null != openBankInfo.getId()) {
        OpenBankInfo newOpenBankInfo = new OpenBankInfo();
        OpenBankInfo oldOpenBankInfo = selectByPrimaryKey(openBankInfo.getId());
        newOpenBankInfo.setBankAddress(oldOpenBankInfo.getBankAddress());
        newOpenBankInfo.setBankNumber(oldOpenBankInfo.getBankNumber());
        newOpenBankInfo.setCreateTime(new Date());
        newOpenBankInfo.setEnterprise(enterpriseId);
        newOpenBankInfo.setExtraBill(billId);
        newOpenBankInfo.setItemStatus(itemStatus);
        newOpenBankInfo.setTaxNumber(oldOpenBankInfo.getTaxNumber());
        newOpenBankInfo.setUserInfo(userInfoId);
        newOpenBankInfo = insert(newOpenBankInfo);
        return newOpenBankInfo;
    }
    openBankInfo.setCreateTime(new Date());
    openBankInfo.setEnterprise(enterpriseId);
    openBankInfo.setExtraBill(billId);
    openBankInfo.setItemStatus(itemStatus);
    openBankInfo.setUserInfo(userInfoId);
    if (old == null) {
        openBankInfo = insert(openBankInfo);
    } else {
        openBankInfo.setId(old.getId());
        ;
        updateByPrimaryKeySelective(openBankInfo);
    }
    sqlSession.flushStatements();
    return openBankInfo;
}
Also used : OpenBankInfo(com.itrus.portal.db.OpenBankInfo) Date(java.util.Date)

Example 18 with OpenBankInfo

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

the class OpenBankInfoServiceImpl method selectByPrimaryKey.

public OpenBankInfo selectByPrimaryKey(Long id) {
    OpenBankInfoMapper mapper = sqlSession.getMapper(OpenBankInfoMapper.class);
    OpenBankInfo OpenBankInfo = mapper.selectByPrimaryKey(id);
    return OpenBankInfo;
}
Also used : OpenBankInfo(com.itrus.portal.db.OpenBankInfo) OpenBankInfoMapper(com.itrus.portal.db.OpenBankInfoMapper)

Example 19 with OpenBankInfo

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

the class OpenBankInfoServiceImpl method getOpenBankInfosNews.

/**
 * 根据企业名称查找开户行信息,按生成时间降序排序
 *
 * @param enterpriseId
 * @return
 * @throws Exception
 */
public List<OpenBankInfo> getOpenBankInfosNews(Long enterpriseId) throws Exception {
    List<OpenBankInfo> openBankInfos = new ArrayList<OpenBankInfo>();
    OpenBankInfoExample example = new OpenBankInfoExample();
    example.setOrderByClause("create_time DESC");
    OpenBankInfoExample.Criteria criteria = example.or();
    criteria.andEnterpriseEqualTo(enterpriseId);
    openBankInfos = selectByExample(example);
    return openBankInfos;
}
Also used : OpenBankInfo(com.itrus.portal.db.OpenBankInfo) ArrayList(java.util.ArrayList) OpenBankInfoExample(com.itrus.portal.db.OpenBankInfoExample)

Aggregations

OpenBankInfo (com.itrus.portal.db.OpenBankInfo)19 Enterprise (com.itrus.portal.db.Enterprise)14 BusinessLicense (com.itrus.portal.db.BusinessLicense)13 TaxRegisterCert (com.itrus.portal.db.TaxRegisterCert)13 ExtraProduct (com.itrus.portal.db.ExtraProduct)12 UserInfo (com.itrus.portal.db.UserInfo)12 ExtraBill (com.itrus.portal.db.ExtraBill)11 IdentityCard (com.itrus.portal.db.IdentityCard)11 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)10 OrgCode (com.itrus.portal.db.OrgCode)9 Agent (com.itrus.portal.db.Agent)8 ExtraProductSpec (com.itrus.portal.db.ExtraProductSpec)8 HashMap (java.util.HashMap)7 OnPayInfo (com.itrus.portal.db.OnPayInfo)6 TransactionStatus (org.springframework.transaction.TransactionStatus)6 DefaultTransactionDefinition (org.springframework.transaction.support.DefaultTransactionDefinition)6 Einvoice (com.itrus.portal.db.Einvoice)5 ExtraBillExample (com.itrus.portal.db.ExtraBillExample)5 Project (com.itrus.portal.db.Project)5 ServiceProvider (com.itrus.portal.db.ServiceProvider)5