Search in sources :

Example 6 with ServiceProvider

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

the class ExtraBillPayController method show.

// 显示详情
@RequestMapping(value = "/{id}", produces = "text/html")
public String show(@PathVariable("id") Long id, Model uiModel, @RequestParam(value = "payStatus", required = false) Integer payStatus) {
    uiModel.addAttribute("payStatus", payStatus);
    // 管理员项目权限
    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);
    if (onPayInfo != null && onPayInfo.getOnlinePay() != null) {
        // 在线支付
        OnlinePay onlinePay = sqlSession.selectOne("com.itrus.portal.db.OnlinePayMapper.selectByPrimaryKey", onPayInfo.getOnlinePay());
        uiModel.addAttribute("onlinePay", onlinePay);
    }
    // 电子发票
    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 "extrabillpay/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) OnlinePay(com.itrus.portal.db.OnlinePay) IdentityCard(com.itrus.portal.db.IdentityCard) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 7 with ServiceProvider

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

the class ServiceProviderController method list.

// 遍历页面
@RequestMapping(produces = "text/html")
public String list(@RequestParam(value = "queryDate1", required = false) Date queryDate1, @RequestParam(value = "queryDate2", required = false) Date queryDate2, @RequestParam(value = "name", required = false) String name, @RequestParam(value = "contactsName", required = false) String contactsName, @RequestParam(value = "contactsMphone", required = false) String contactsMphone, @RequestParam(value = "page", required = false) Integer page, @RequestParam(value = "size", required = false) Integer size, Model uiModel) throws Exception {
    if (queryDate1 == null && queryDate2 == null) {
        Calendar calendar = Calendar.getInstance();
        calendar.add(Calendar.DATE, 1);
        calendar.set(Calendar.HOUR_OF_DAY, 0);
        calendar.set(Calendar.MINUTE, 0);
        calendar.set(Calendar.SECOND, 0);
        calendar.set(Calendar.MILLISECOND, 0);
        calendar.add(Calendar.MILLISECOND, -1);
        queryDate2 = calendar.getTime();
        calendar.add(Calendar.MILLISECOND, 1);
        calendar.add(Calendar.MONTH, -1);
        queryDate1 = calendar.getTime();
    }
    if (page == null || page < 1)
        page = 1;
    if (size == null || size < 1)
        size = 10;
    Integer offset = size * (page - 1);
    ServiceProviderExample example = new ServiceProviderExample();
    ServiceProviderExample.Criteria criteria = example.createCriteria();
    criteria.andCreateTimeBetween(queryDate1, queryDate2);
    Integer count = ServiceProviderService.countByExample(example);
    example.setLimit(size);
    example.setOffset(offset);
    if (StringUtils.isNotBlank(name)) {
        criteria.andNameLike(name);
    }
    if (StringUtils.isNotBlank(contactsName)) {
        criteria.andContactsNameLike(contactsName);
    }
    if (StringUtils.isNotBlank(contactsMphone)) {
        criteria.andContactsMphoneLike(contactsMphone);
    }
    List<ServiceProvider> serviceProviders = ServiceProviderService.selectByExample(example);
    uiModel.addAttribute("serviceProviders", serviceProviders);
    uiModel.addAttribute("queryDate1", queryDate1);
    uiModel.addAttribute("queryDate2", queryDate2);
    uiModel.addAttribute("name", name);
    uiModel.addAttribute("contactsName", contactsName);
    uiModel.addAttribute("contactsMphone", contactsMphone);
    uiModel.addAttribute("page", page);
    uiModel.addAttribute("size", size);
    uiModel.addAttribute("count", count);
    return "serviceprovider/list";
}
Also used : Calendar(java.util.Calendar) ServiceProvider(com.itrus.portal.db.ServiceProvider) ServiceProviderExample(com.itrus.portal.db.ServiceProviderExample) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 8 with ServiceProvider

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

the class ServiceProviderServiceImpl method selectByExample.

public List<ServiceProvider> selectByExample(ServiceProviderExample example) throws Exception {
    ServiceProviderMapper mapper = sqlSession.getMapper(ServiceProviderMapper.class);
    List<ServiceProvider> list = mapper.selectByExample(example);
    return list;
}
Also used : ServiceProviderMapper(com.itrus.portal.db.ServiceProviderMapper) ServiceProvider(com.itrus.portal.db.ServiceProvider)

Example 9 with ServiceProvider

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

the class ServiceProviderServiceImpl method selectByPrimaryKey.

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

Example 10 with ServiceProvider

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

the class ServiceProviderController method show.

// 显示详情页面
@RequestMapping(value = "/show/{id}", produces = "text/html")
public String show(@PathVariable("id") Long id, Model uiModel) throws Exception {
    ServiceProvider serviceProvider = ServiceProviderService.selectByPrimaryKey(id);
    uiModel.addAttribute("serviceProvider", serviceProvider);
    List<ServiceHall> serviceHalls = serviceHallService.getServiceHalls(serviceProvider.getId());
    uiModel.addAttribute("serviceHalls", serviceHalls);
    List<ExtraProduct> products = extraProductService.getProductsByServiceProviderId(serviceProvider.getId());
    uiModel.addAttribute("products", products);
    return "serviceprovider/show";
}
Also used : ExtraProduct(com.itrus.portal.db.ExtraProduct) ServiceProvider(com.itrus.portal.db.ServiceProvider) ServiceHall(com.itrus.portal.db.ServiceHall) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

ServiceProvider (com.itrus.portal.db.ServiceProvider)16 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)14 ExtraProduct (com.itrus.portal.db.ExtraProduct)11 ExtraProductSpec (com.itrus.portal.db.ExtraProductSpec)9 Enterprise (com.itrus.portal.db.Enterprise)6 Ereceipt (com.itrus.portal.db.Ereceipt)6 UserInfo (com.itrus.portal.db.UserInfo)6 Agent (com.itrus.portal.db.Agent)5 BusinessLicense (com.itrus.portal.db.BusinessLicense)5 ExtraBill (com.itrus.portal.db.ExtraBill)5 IdentityCard (com.itrus.portal.db.IdentityCard)5 OnlinePay (com.itrus.portal.db.OnlinePay)5 OpenBankInfo (com.itrus.portal.db.OpenBankInfo)5 OrgCode (com.itrus.portal.db.OrgCode)5 TaxRegisterCert (com.itrus.portal.db.TaxRegisterCert)5 Einvoice (com.itrus.portal.db.Einvoice)4 ExtraBillExample (com.itrus.portal.db.ExtraBillExample)4 OnPayInfo (com.itrus.portal.db.OnPayInfo)4 Project (com.itrus.portal.db.Project)4 ServiceHall (com.itrus.portal.db.ServiceHall)4