use of com.itrus.portal.db.Project 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.Project 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.Project in project portal by ixinportal.
the class ExtraBillReviewController method sendSmsBySHJJ.
/**
* 手动发送审核拒绝短信通知
*
* @param billId
* @return
*/
@RequestMapping("/sendSmsBySHJJ")
@ResponseBody
public synchronized Map<String, Object> sendSmsBySHJJ(@RequestParam(value = "billId", required = true) Long billId) {
Map<String, Object> retMap = new HashMap<String, Object>();
retMap.put("retCode", 0);
// 修改订单
ExtraBill bill = extraBillService.selectByPrimaryKey(billId);
if (null == bill) {
retMap.put("retMsg", "订单不存在");
return retMap;
}
// 查询短信模版
// 查找对应项目的消息模版:SHJJ
MessageTemplate messageTemplate = messageTemplateService.getMsgTemp(bill.getProject(), "SHJJ");
if (null == messageTemplate) {
retMap.put("retMsg", "审核拒绝短信模版不存在,请联系系统管理员配置");
return retMap;
}
Enterprise enterprise = sqlSession.selectOne("com.itrus.portal.db.EnterpriseMapper.selectByPrimaryKey", bill.getEnterprise());
ExtraProduct product = extraProductService.selectByPrimaryKey(bill.getExtraProduct());
Project project = sqlSession.selectOne("com.itrus.portal.db.ProjectMapper.selectByPrimaryKey", bill.getProject());
UserInfo userInfo = sqlSession.selectOne("com.itrus.portal.db.UserInfoMapper.selectByPrimaryKey", bill.getUniqueId());
String content = messageTemplate.getMessageContent();
// 替换特定内容:企业名称:enterpriseName,产品名称:productName,项目名称:projectName,拒绝原因:reason
if (content.contains("enterpriseName")) {
content = content.replaceAll("enterpriseName", enterprise.getEnterpriseName());
}
if (content.contains("productName")) {
content = content.replaceAll("productName", product.getAppName());
}
if (content.contains("projectName")) {
content = content.replaceAll("projectName", project.getName());
}
if (content.contains("reason")) {
content = content.replaceAll("reason", bill.getRefuseReason());
}
// 发送短信
try {
smsSendService.sendRefuseReview(userInfo.getmPhone(), content, "SHJJ", project.getId(), userInfo.getUniqueId(), bill.getBillId());
} catch (Exception e) {
e.printStackTrace();
}
bill.setIsRefuseSms(true);
bill.setSendTime(new Date());
try {
extraBillService.updateByPrimaryKey(bill);
retMap.put("retCode", 1);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return retMap;
}
use of com.itrus.portal.db.Project in project portal by ixinportal.
the class ExtraProductReleaseController method list.
// 遍历页面
@RequestMapping(produces = "text/html")
public String list(@RequestParam(value = "project", required = false) Long project, @RequestParam(value = "extraProduct", required = false) Long extraProduct, @RequestParam(value = "appType", required = false) Long appType, @RequestParam(value = "appTypeExt", required = false) Long appTypeExt, @RequestParam(value = "page", required = false) Integer page, @RequestParam(value = "size", required = false) Integer size, Model uiModel) throws Exception {
if (page == null || page < 1)
page = 1;
if (size == null || size < 1)
size = 10;
Integer offset = size * (page - 1);
ExtraProductReleaseExample example = new ExtraProductReleaseExample();
example.setLimit(size);
example.setOffset(offset);
// 所有的项目信息,以id为主键.以便页面显示信息
Map<Long, Project> projectMap = new HashMap<Long, Project>();
projectMap = projectService.getProjectMapByExample(null);
// 所有的增值产品信息,以id为主键.以便页面显示信息
Map<Long, ExtraProduct> extraProductMap = new HashMap<Long, ExtraProduct>();
extraProductMap = extraProductService.selectMapByExample(null);
Criteria criteria = example.createCriteria();
if (project != null) {
criteria.andProjectEqualTo(project);
}
if (extraProduct != null) {
criteria.andExtraProductEqualTo(extraProduct);
}
criteria.andAppTypeIsNotNull();
criteria.andAppTypeNotEqualTo("");
if (appType != null) {
criteria.andAppTypeLike("%" + appType + "%");
}
List<ExtraProductRelease> extraProductReleases = extraProductReleaseService.selectByExample(example);
// 去除不包含所选 发布平台的记录
if (appType != null) {
Iterator<ExtraProductRelease> it = extraProductReleases.iterator();
while (it.hasNext()) {
ExtraProductRelease epr = it.next();
String appTypes = epr.getAppType();
boolean isHas = false;
for (String at : appTypes.split(",")) {
if (appType.toString().equals(at)) {
isHas = true;
break;
}
}
if (!isHas) {
it.remove();
}
}
}
Integer count = extraProductReleases.size();
uiModel.addAttribute("count", count);
uiModel.addAttribute("pages", (count + size - 1) / size);
// page, size
if (page > 1 && size * (page - 1) >= count) {
page = (count + size - 1) / size;
}
uiModel.addAttribute("page", page);
uiModel.addAttribute("size", size);
uiModel.addAttribute("projectCur", project);
uiModel.addAttribute("extraProductCur", extraProduct);
uiModel.addAttribute("appTypesCur", appType);
uiModel.addAttribute("appTypeExt", appTypeExt);
uiModel.addAttribute("projectMap", projectMap);
uiModel.addAttribute("extraProductMap", extraProductMap);
uiModel.addAttribute("extraProductReleases", extraProductReleases);
return "extraproductrelease/list";
}
use of com.itrus.portal.db.Project in project portal by ixinportal.
the class ExtraProductReleaseController method show.
// 显示详情页面
@RequestMapping(value = "/show/{id}", produces = "text/html")
public String show(@PathVariable("id") Long id, Model uiModel) throws Exception {
Project project = projectService.selectByPrimaryKey(id);
List<ExtraProductRelease> extraProductReleases = extraProductReleaseService.getByprojectId(id);
// 所有的增值产品信息,以id为主键.以便页面显示信息
Map<Long, ExtraProduct> extraProductMap = new HashMap<Long, ExtraProduct>();
extraProductMap = extraProductService.selectMapByExample(null);
// 项目信息
uiModel.addAttribute("project", project);
// 产品与项目之间的关系
uiModel.addAttribute("extraProductReleases", extraProductReleases);
// 所有的产品
uiModel.addAttribute("extraProductMap", extraProductMap);
// 显示新建的增值产品,还未与项目产生关联
ExtraProductExample epe = new ExtraProductExample();
ExtraProductExample.Criteria epec = epe.createCriteria();
List<Long> havedProductIds = new ArrayList<>();
for (ExtraProductRelease epr : extraProductReleases) {
havedProductIds.add(epr.getExtraProduct());
}
if (havedProductIds != null && havedProductIds.size() > 0) {
epec.andIdNotIn(havedProductIds);
}
epe.setOrderByClause("id asc");
// 没有与该项目产生关联关系的增值产品
List<ExtraProduct> remainingProducts = extraProductService.selectByExample(epe);
uiModel.addAttribute("remainingProducts", remainingProducts);
return "extraproductrelease/show";
}
Aggregations