use of com.itrus.portal.db.Transfer in project portal by ixinportal.
the class TransferController method show.
// 显示银行汇款详情
@RequestMapping(value = "/{id}", produces = "text/html")
public String show(@PathVariable("id") Long id, Model uiModel) {
Transfer transfer = sqlSession.selectOne("com.itrus.portal.db.TransferMapper.selectByPrimaryKey", id);
uiModel.addAttribute("transfer", transfer);
return "transfer/show";
}
use of com.itrus.portal.db.Transfer in project portal by ixinportal.
the class ExtraProductController method show.
// 显示详情页面
@RequestMapping(value = "/show/{id}", produces = "text/html")
public String show(@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/show";
}
use of com.itrus.portal.db.Transfer in project portal by ixinportal.
the class ExtraProductController method updatePage.
// 修改基础信息和产品规格信息页面
@RequestMapping(value = "/update/{id}", produces = "text/html")
public String updatePage(@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);
return "extraproduct/update";
}
use of com.itrus.portal.db.Transfer in project portal by ixinportal.
the class ClientWebController method zhifuPage.
/**
* 进入增值订单支付页面,若未配置支付且订单价格为0,则不需要支付
*
* @param billId
* ,增值订单id
* @param request
* @param uiModel
* @return
*/
@RequestMapping("/zhifu/{billId}")
public String zhifuPage(@PathVariable("billId") Long billId, HttpServletRequest request, Model uiModel) {
HttpSession session = request.getSession();
String ip = request.getRemoteAddr();
UserInfo currentUserInfo = (UserInfo) session.getAttribute("webuserInfo");
uiModel.addAttribute("ip", ip);
// 增值订单
ExtraBill bill = extraBillService.selectByPrimaryKey(billId);
if (null == bill || !currentUserInfo.getId().equals(bill.getUniqueId())) {
return "resourceNotFound";
}
// 增值产品
ExtraProduct product = extraProductService.selectByPrimaryKey(bill.getExtraProduct());
if (null == product) {
// 产品不存在
uiModel.addAttribute("errorMsg", "您购买的产品不存在");
return "client/errorpage";
}
// 未配置支付方式,或者订单价格为0,则不用支付
if (StringUtils.isBlank(product.getBankPay()) && StringUtils.isBlank(product.getOnlinePay()) && (null == bill.getBillSum() || bill.getBillSum().equals(0))) {
// 跳转到订单支付成功页面,并将订单状态设置为3已支付 待审核
bill.setBillStatus(ComNames.EXTRA_BILL_STATUS_3);
// TODO 跳转到支付成功或者订单列表页面
return "client/zhifuchenggong";
}
// 获取产品对应的线上支付服务
if (product.getOnlinePay() != null && product.getOnlinePay() != "") {
List<Long> onlinepays = new ArrayList<Long>();
String[] onpay = (product.getOnlinePay()).split(",");
Map<Integer, String> map = new HashMap<Integer, String>();
for (int i = 0; i < onpay.length; i++) {
OnlinePay op = sqlSession.selectOne("com.itrus.portal.db.OnlinePayMapper.selectByPrimaryKey", onpay[i]);
map.put(op.getSort(), onpay[i]);
}
Set<Integer> set = map.keySet();
Object[] obj = set.toArray();
Arrays.sort(obj);
for (int i = (onpay.length - 1); i >= 0; i--) {
String a = map.get(obj[i]);
onlinepays.add(Long.parseLong(a));
}
Map<Long, OnlinePay> opMap = sqlSession.selectMap("com.itrus.portal.db.OnlinePayMapper.selectByExample", "id");
uiModel.addAttribute("opMap", opMap);
uiModel.addAttribute("onlinepays", onlinepays);
Map<Long, PayConfig> pcMap = sqlSession.selectMap("com.itrus.portal.db.PayConfigMapper.selectByExample", "id");
uiModel.addAttribute("pcMap", pcMap);
}
// 获取产品对应的银行汇款服务
if (!StringUtils.isBlank(product.getBankPay())) {
Transfer transfer = sqlSession.selectOne("com.itrus.portal.db.TransferMapper.selectByPrimaryKey", Long.parseLong(product.getBankPay()));
uiModel.addAttribute("transfer", transfer);
}
if (null != product.getBankRemarks()) {
product.setBankRemarks(product.getBankRemarks().replace("\r\n", "<br/><span ></span>"));
}
uiModel.addAttribute("product", product);
session.setAttribute("webbill", bill);
if (null != bill.getExtraProductSpec()) {
uiModel.addAttribute("productSpec", extraProductSpecService.selectByPrimaryKey(bill.getExtraProductSpec()));
}
if (currentUserInfo != null) {
currentUserInfo = userInfoService.getUserInfoById(currentUserInfo.getId());
EnterpriseQqExample enterpriseE = new EnterpriseQqExample();
EnterpriseQqExample.Criteria qqEx = enterpriseE.createCriteria();
qqEx.andProjectIdEqualTo(currentUserInfo.getProject());
EnterpriseQq enterpriseqq = sqlSession.selectOne("com.itrus.portal.db.EnterpriseQqMapper.selectByExample", enterpriseE);
if (enterpriseqq != null && enterpriseqq.getEnterpriseQqLinks() != null) {
uiModel.addAttribute("enterpriseqq", enterpriseqq.getEnterpriseQqLinks());
session.setAttribute("enterpriseqqE", enterpriseqq.getEnterpriseQqLinks());
}
}
// TODO 跳转到支付页面
return "client/zhifu";
}
use of com.itrus.portal.db.Transfer in project portal by ixinportal.
the class UnlockKeyBillController method zhifuPage.
/**
* 3进入支付页面
*
* @param billId
* @param request
* @param uiModel
* @return
*/
@RequestMapping("/zhifu/{billId}")
public String zhifuPage(@PathVariable("billId") Long billId, @RequestParam(value = "certSn", required = false) String certSn, @RequestParam(value = "keySn", required = false) String keySn, @RequestParam(value = "enterpriseName", required = false) String enterpriseName, HttpServletRequest request, Model uiModel) {
HttpSession session = request.getSession();
String ip = request.getRemoteAddr();
uiModel.addAttribute("ip", ip);
Bill bill = sqlSession.selectOne("com.itrus.portal.db.BillMapper.selectByPrimaryKey", billId);
if (null == bill) {
return "resourceNotFound";
}
// 产品
Product product = sqlSession.selectOne("com.itrus.portal.db.ProductMapper.selectByPrimaryKey", bill.getProduct());
if (null == product) {
// 产品不存在
uiModel.addAttribute("errorMsg", "您购买的产品不存在");
return ComNames.CLIENTFW_ERRORPAGE;
}
if (null == product.getOnpay() && StringUtils.isBlank(product.getPay()) && bill.getBillSum().equals(0.00)) {
// 跳转到订单支付成功页面,并将订单状态设置为3已支付 待审核
if (null != product.getKeyUnlockType()) {
bill = unLockKeyBillService.updateBillStatusWhileHasPay(bill, product);
} else {
bill.setBillStatus(ComNames.BILL_STATUS_3);
}
sqlSession.update("com.itrus.portal.db.BillMapper.updateByPrimaryKey", bill);
session.setAttribute("webbill", bill);
if (null != product.getKeyUnlockType()) {
UserCert userCert = userCertService.selectByPrimaryKey(bill.getUnlockUserCert());
Enterprise enterprise = enterpriseService.getEnterpriseById(bill.getEnterprise());
return "redirect:/doUnlockKey/toUnlockKeyPage?" + "billId=" + billId + "&certSn=" + userCert.getCertSn() + "&keySn=" + userCert.getKeySn() + "&enterpriseName=" + enterprise.getEnterpriseName();
} else {
return "redirect:/billClient";
}
}
// 获取产品对应的线上支付服务
if (product.getOnpay() != null && product.getOnpay() != "") {
List<Long> onlinepays = new ArrayList<Long>();
String[] onpay = (product.getOnpay()).split(",");
// 过滤掉不是服务型客户的在线支付
onpay = onlinePayService.removeOnlinePayWithOutClientFw(onpay);
Map<Integer, String> map = new HashMap<Integer, String>();
for (int i = 0; i < onpay.length; i++) {
OnlinePay op = sqlSession.selectOne("com.itrus.portal.db.OnlinePayMapper.selectByPrimaryKey", onpay[i]);
map.put(op.getSort(), onpay[i]);
}
Set<Integer> set = map.keySet();
Object[] obj = set.toArray();
Arrays.sort(obj);
for (int i = (onpay.length - 1); i >= 0; i--) {
String a = map.get(obj[i]);
onlinepays.add(Long.parseLong(a));
}
Map<Long, OnlinePay> opMap = sqlSession.selectMap("com.itrus.portal.db.OnlinePayMapper.selectByExample", "id");
uiModel.addAttribute("opMap", opMap);
uiModel.addAttribute("onlinepays", onlinepays);
Map<Long, PayConfig> pcMap = sqlSession.selectMap("com.itrus.portal.db.PayConfigMapper.selectByExample", "id");
uiModel.addAttribute("pcMap", pcMap);
}
// 获取产品对应的银行汇款服务
if (!StringUtils.isBlank(product.getPay())) {
Transfer transfer = sqlSession.selectOne("com.itrus.portal.db.TransferMapper.selectByPrimaryKey", Long.parseLong(product.getPay()));
uiModel.addAttribute("transfer", transfer);
}
if (null != product.getTransferNotes()) {
product.setTransferNotes(product.getTransferNotes().replace("\r\n", "<br/><span ></span>"));
}
// 解锁订单,返回keysn,certsn,enterprisename
if (null != product.getKeyUnlockType() && (StringUtils.isBlank(keySn) || StringUtils.isBlank(certSn) || StringUtils.isBlank(enterpriseName))) {
Enterprise enterprise = enterpriseService.getEnterpriseById(bill.getEnterprise());
enterpriseName = enterprise.getEnterpriseName();
UserCert userCert = userCertService.selectByPrimaryKey(bill.getUnlockUserCert());
if (null != userCert && StringUtils.isNotBlank(userCert.getKeySn())) {
keySn = userCert.getKeySn();
}
if (null != userCert && StringUtils.isNotBlank(userCert.getCertSn())) {
certSn = userCert.getCertSn();
}
}
uiModel.addAttribute("product", product);
uiModel.addAttribute("certSn", certSn);
uiModel.addAttribute("keySn", keySn);
uiModel.addAttribute("enterpriseName", enterpriseName);
session.setAttribute("webbill", bill);
if (null != product.getCert()) {
// 产品关联的数字证书
DigitalCert digitalCert = sqlSession.selectOne("com.itrus.portal.db.DigitalCertMapper.selectByPrimaryKey", product.getCert());
// 用于获取产品期限(数字证书的期限)
uiModel.addAttribute("digitalCert", digitalCert);
}
return "clientFW/pay";
}
Aggregations