use of com.itrus.portal.db.ExtraProduct in project portal by ixinportal.
the class BaiWangEmailServiceImpl method sendEmailToUser.
public Map<String, Object> sendEmailToUser(ExtraBill bill) throws MessagingException, Exception {
Map<String, Object> retMap = new HashMap<>();
retMap.put("retCode", 0);
Project project = projectService.selectByPrimaryKey(bill.getProject());
ExtraProduct product = extraProductService.selectByPrimaryKey(bill.getExtraProduct());
UserInfo userInfo = userInfoService.getUserInfoById(bill.getUniqueId());
if (StringUtils.isBlank(userInfo.getEmail())) {
retMap.put("retMsg", "尚未登记邮箱,请登记邮箱并验证");
return retMap;
}
if (null == userInfo.getTrustEmail() || userInfo.getTrustEmail().equals(false)) {
retMap.put("retMsg", "您的邮箱尚未通过验证,请验证通过后再处理");
return retMap;
}
Enterprise enterprise = enterpriseService.getEnterpriseById(bill.getEnterprise());
MailTemplate mailTemplate = mailTemplateService.getMailTemplatesByProjectIdAndType(bill.getProject(), ComNames.MAIL_TEMPLATE_BWDJTZ);
if (null == mailTemplate) {
retMap.put("retMsg", "服务端出现未知错误,请联系系统管理员,错误代码:bwtz001");
LogUtil.syslog(sqlSession, "邮件模版异常", "项目:" + bill.getProject() + ", 未配置百望单机通知邮件模版");
return retMap;
}
// 给订单对应的用户发送邮件信息
String[] mailOfUser = new String[] { userInfo.getEmail() };
Map<String, File> proxyMap = new HashMap<String, File>();
String instructions = product.getInstructions();
File filePath = extraProductService.getFilePathById(product.getId());
if (!filePath.exists()) {
filePath.mkdir();
}
File file = new File(filePath, instructions);
proxyMap.put("单机版开票软件操作指南.fdf", file);
String subject = mailTemplate.getName().replace("projectname", project.getName()).replace("productname", product.getAppName());
Bwdjrecord bwdjrecord = bwdjRecordService.getBwdjrecordByExtraBillId(bill.getId());
String content = mailTemplate.getContent().replace("downloadurl", bwdjrecord.getDownLoadUrl());
sendEmailService.sendEmail(content, mailOfUser, subject, false, proxyMap);
retMap.put("retCode", 1);
return retMap;
}
use of com.itrus.portal.db.ExtraProduct in project portal by ixinportal.
the class ExtraBillServiceImpl method getExtraProductMapByUserInfoId.
/**
* 根据用户id查询订单表中对应的产品Map
*
* @param userInfo
* @return
* @throws Exception
*/
public Map<Long, ExtraProduct> getExtraProductMapByUserInfoId(Long userInfo) throws Exception {
Map<Long, ExtraProduct> productMap = new HashMap<Long, ExtraProduct>();
List<Long> productIds = sqlSession.selectList("com.itrus.portal.db.ExtraBillMapper.selectExraProductsByUserInfo", userInfo);
if (null != productIds && !productIds.isEmpty()) {
ExtraProductExample example = new ExtraProductExample();
ExtraProductExample.Criteria criteria = example.or();
criteria.andIdIn(productIds);
productMap = extraProductService.selectMapByExample(example);
}
return productMap;
}
use of com.itrus.portal.db.ExtraProduct in project portal by ixinportal.
the class ExtraProductServiceImpl method getProductsByServiceProviderId.
/**
* 根据服务商id,获取服务商下面的产品
* @param serviceProviderId
* @return
* @throws Exception
*/
public List<ExtraProduct> getProductsByServiceProviderId(Long serviceProviderId) throws Exception {
List<ExtraProduct> extraProducts = new ArrayList<>();
ExtraProductExample example = new ExtraProductExample();
ExtraProductExample.Criteria criteria = example.or();
criteria.andServiceProviderEqualTo(serviceProviderId);
extraProducts = selectByExample(example);
return extraProducts;
}
use of com.itrus.portal.db.ExtraProduct in project portal by ixinportal.
the class ExtraProductServiceImpl method getExtraProductBySIN.
/**
* 根据服务商接口标识,返回对应的增值产品
* @param serviceInterfaceName
* @return
* @throws Exception
*/
public List<ExtraProduct> getExtraProductBySIN(Long serviceInterfaceName) throws Exception {
if (null == serviceInterfaceName) {
return null;
}
List<ExtraProduct> extraProducts = new ArrayList<>();
ExtraProductExample example = new ExtraProductExample();
ExtraProductExample.Criteria criteria = example.or();
criteria.andServiceInterfaceNameEqualTo(serviceInterfaceName);
extraProducts = selectByExample(example);
return extraProducts;
}
use of com.itrus.portal.db.ExtraProduct in project portal by ixinportal.
the class ExtraProductServiceImpl method selectByExample.
public List<ExtraProduct> selectByExample(ExtraProductExample example) throws Exception {
ExtraProductMapper mapper = sqlSession.getMapper(ExtraProductMapper.class);
List<ExtraProduct> list = mapper.selectByExample(example);
return list;
}
Aggregations