use of com.itrus.portal.db.ServiceProvider in project portal by ixinportal.
the class ServiceProviderController method update.
// 修改页面
@RequestMapping(value = "/{id}", params = "form", produces = "text/html")
public String update(@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);
return "serviceprovider/update";
}
use of com.itrus.portal.db.ServiceProvider in project portal by ixinportal.
the class ServiceProviderController method delete.
// 删除服务商
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE, produces = "text/html")
@ResponseBody
public String delete(@PathVariable("id") Long id) {
ServiceProvider serviceProvider = ServiceProviderService.selectByPrimaryKey(id);
if (null == serviceProvider) {
return "未找到要删除的服务商";
} else {
try {
ServiceProviderService.deleteByPrimaryKey(id);
List<ServiceHall> serviceHalls = serviceHallService.getServiceHalls(id);
if (null != serviceHalls && !serviceHalls.isEmpty()) {
List<Long> list = new ArrayList<>();
for (ServiceHall serviceHall : serviceHalls) {
list.add(serviceHall.getId());
}
ServiceHallExample example = new ServiceHallExample();
ServiceHallExample.Criteria criteria = example.or();
criteria.andServiceProviderIn(list);
serviceHallService.deleteByExample(example);
}
} catch (Exception e) {
return "要删除的服务商:" + serviceProvider.getName() + "存在关联,无法删除";
}
}
return null;
}
use of com.itrus.portal.db.ServiceProvider 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";
}
use of com.itrus.portal.db.ServiceProvider 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";
}
use of com.itrus.portal.db.ServiceProvider in project portal by ixinportal.
the class ExtraProductController method updateMorePage.
// 返回修改产品对应的服务信息页面:服务办理接口信息,服务应用方式,服务配置
@RequestMapping(value = "/updateMore/{id}", produces = "text/html")
public String updateMorePage(@PathVariable("id") Long id, Model uiModel) throws Exception {
ExtraProduct extraProduct = extraProductService.selectByPrimaryKey(id);
uiModel.addAttribute("extraProduct", extraProduct);
List<ExtraProductSpec> extraProductSpecs = extraProductSpecService.getSpecByProductId(id);
uiModel.addAttribute("extraProductSpecs", extraProductSpecs);
// 服务提供商组成的map
Map<Long, ServiceProvider> serviceProviderMap = serviceProviderService.selectMapByExample(null);
uiModel.addAttribute("serviceProviderMap", serviceProviderMap);
// 在线支付的map:微信和支付宝
List<OnlinePay> onlinepays = sqlSession.selectList("com.itrus.portal.db.OnlinePayMapper.selectByExample", null);
uiModel.addAttribute("onlinepays", onlinepays);
// 银行付款的List
List<Transfer> bankPays = sqlSession.selectList("com.itrus.portal.db.TransferMapper.selectByExample", null);
uiModel.addAttribute("bankPays", bankPays);
// 电子发票的list
List<Ereceipt> einvoices = sqlSession.selectList("com.itrus.portal.db.EreceiptMapper.selectByExample", null);
uiModel.addAttribute("einvoices", einvoices);
// 附加项的list
List<ExtraMessage> extraMessages = extraMessageService.selectByExample(null);
uiModel.addAttribute("extraMessages", extraMessages);
return "extraproduct/update2";
}
Aggregations