use of com.itrus.portal.db.Enterprise in project portal by ixinportal.
the class CustomerServerClientController method onLine.
/**
* 用户登录后的客服在线
* @param certSn
* @param keySn
* @param enterpriseName
* @param session
* @param uiModel
* @return
*/
@RequestMapping("/online")
public String onLine(@RequestParam(value = "certSn", required = false) String certSn, @RequestParam(value = "keySn", required = false) String keySn, @RequestParam(value = "enterpriseName", required = false) String enterpriseName, HttpSession session, Model uiModel) {
// TODO
Boolean verifyCodeStatus = (Boolean) session.getAttribute(ComNames.WEB_VERIFY_CODE_STATUS);
Enterprise enterprise = (Enterprise) session.getAttribute(ComNames.WEB_ENTERPRISE);
UserInfo userInfo = (UserInfo) session.getAttribute(ComNames.WEB_USER_INFO);
if (null == verifyCodeStatus || !verifyCodeStatus || null == userInfo) {
// 登录状态失效,跳转到登录页面
return ComNames.DENG_LU_CLIENT;
}
// 先根据key序列号取项目,若没有,则根据用户所属项目取项目信息
Project project = null;
if (StringUtils.isNotBlank(keySn)) {
ProjectKeyInfo projectKeyInfo = cacheCustomer.findProjectByKey(keySn);
if (null == projectKeyInfo) {
uiModel.addAttribute("errorMsg", "无法识别的key序列号:" + keySn + ", 请联系系统管理员进行配置");
return ComNames.CLIENTFW_ERRORPAGE;
}
project = projectService.selectByPrimaryKey(projectKeyInfo.getProject());
}
// 若项目为Null,而certsn不为null,则尝试从数据库获取keysn,查找项目
if (null == project && StringUtils.isNotBlank(certSn)) {
UserCert userCert = userCertService.getUserCertByCertSn(certSn);
if (null != userCert && StringUtils.isNotBlank(userCert.getKeySn())) {
ProjectKeyInfo projectKeyInfo = cacheCustomer.findProjectByKey(userCert.getKeySn());
if (null != projectKeyInfo) {
project = projectService.selectByPrimaryKey(projectKeyInfo.getProject());
}
}
}
if (null == project) {
project = projectService.selectByPrimaryKey(userInfo.getProject());
}
Map<String, String> map = questionService.auth(project.getId());
if (map != null && !map.isEmpty()) {
uiModel.addAttribute("qq", map.get("qq"));
uiModel.addAttribute("phone", map.get("phone"));
uiModel.addAttribute("questionUrl", map.get("questionUrl"));
uiModel.addAttribute("downloadUrl", map.get("downloadUrl"));
}
return "clientFW/kefuzaixian";
}
use of com.itrus.portal.db.Enterprise in project portal by ixinportal.
the class DoUnlockKeyController method toUnlockKeyPage.
/**
* key已经申请了解锁订单,跳转解锁页面
* 1.订单处于未支付,则跳转支付页面
* 2.订单处于已支付,待解锁审批,则跳转查询页面
* 3.订单为审批拒绝,跳转审核拒绝重新提交页面
* 4.订单为审批通过,待解锁,跳转解锁页面
* 5.订单为解锁异常,则跳转解锁异常页面
* 6.订单为解锁完成,则跳转解锁完成页面
* @param certSn
* @param keySn
* @param enterpriseName
* @param uiModel
* @return
*/
@RequestMapping("/toUnlockKeyPage")
public String toUnlockKeyPage(@RequestParam("billId") Long billId, @RequestParam("certSn") String certSn, @RequestParam("keySn") String keySn, @RequestParam("enterpriseName") String enterpriseName, Model uiModel, HttpSession session) {
UserCert userCert = userCertService.getUserCertByCertSn(certSn);
if (null == userCert) {
uiModel.addAttribute("errorMsg", "无法识别该证书,请检查您插入的key是否正确!");
return ComNames.CLIENTFW_ERRORPAGE;
}
// if (null== userCert.getUserinfo() || null == userCert.getEnterprise()) {
// uiModel.addAttribute("errorMsg", "该证书尚未绑定用户或企业");
// return ComNames.CLIENTFW_ERRORPAGE;
// }
Bill bill = billService.getBill(billId);
if (null == bill) {
uiModel.addAttribute("errorMsg", "不存在解锁订单");
return ComNames.CLIENTFW_ERRORPAGE;
}
if (!bill.getUnlockUserCert().equals(userCert.getId())) {
uiModel.addAttribute("errorMsg", "您无权操作该订单");
return ComNames.CLIENTFW_ERRORPAGE;
}
Proxy proxy = proxyService.getProxyByBillId(bill.getId());
Product product = productService.getProduct(bill.getProduct());
UserInfo userInfo = userInfoService.selectByPrimaryKey(bill.getUniqueId());
OnPayInfo onPayInfo = onPayInfoService.selectByPrimaryKey(bill.getOnPayInfo());
Enterprise enterprise = enterpriseService.getEnterpriseById(bill.getEnterprise());
// UserInfo webUserInfo = (UserInfo) session.getAttribute(ComNames.WEB_USER_INFO);
if (null == session.getAttribute(ComNames.WEB_USER_INFO)) {
session.setAttribute(ComNames.WEB_USER_INFO, userInfo);
}
uiModel.addAttribute("mPhone", userInfo.getmPhone());
uiModel.addAttribute("userCert", userCert);
uiModel.addAttribute("keySn", userCert.getKeySn());
uiModel.addAttribute("certSn", userCert.getCertSn());
uiModel.addAttribute("product", product);
uiModel.addAttribute("bill", bill);
uiModel.addAttribute("onPayInfo", onPayInfo);
uiModel.addAttribute("enterprise", enterprise);
uiModel.addAttribute("enterpriseName", enterprise != null ? enterprise.getEnterpriseName() : "");
if (null != proxy) {
// 授权书不一定有
uiModel.addAttribute("proxy", proxy);
}
if (bill.getBillStatus().equals(ComNames.BILL_STATUS_1)) {
// * 1.订单处于未支付,则跳转支付页面 OK
return "redirect:/unlockKeyBill/zhifu/" + billId;
} else if (bill.getBillStatus().equals(ComNames.BILL_STATUS_14)) {
// * 2.订单处于已支付,待解锁审批,则跳转查询页面,
return "clientFW/dengdaishenhe_unlock";
} else if (bill.getBillStatus().equals(ComNames.BILL_STATUS_15)) {
// * 3.订单为审批拒绝,跳转审核拒绝重新提交页面
return "clientFW/dengdaishenhe_unlock";
} else if (bill.getBillStatus().equals(ComNames.BILL_STATUS_16)) {
// * 4.订单为审批通过,待解锁,跳转解锁页面
return "clientFW/unlock";
} else if (bill.getBillStatus().equals(ComNames.BILL_STATUS_17)) {
// * 5.订单为解锁异常,则跳转解锁异常页面
return "redirect:/doUnlockKey/toUnlockFailPage/" + billId;
} else {
uiModel.addAttribute("errorMsg", "订单不处于解锁状态");
return ComNames.CLIENTFW_ERRORPAGE;
}
}
use of com.itrus.portal.db.Enterprise in project portal by ixinportal.
the class RenewUserCertClientController method reNewCertConfirm.
// 订单详情,待更新确认
@RequestMapping(value = "/reNewCertConfirm/{id}", produces = "text/html")
public String reNewCertConfirm(@PathVariable("id") Long id, HttpServletRequest request, Model uiModel) {
HttpSession session = request.getSession();
UserInfo userInfo = (UserInfo) session.getAttribute(ComNames.WEB_USER_INFO);
Enterprise enterprise = (Enterprise) session.getAttribute(ComNames.WEB_ENTERPRISE);
if (null == userInfo || null == enterprise) {
return ComNames.DENG_LU_CLIENT;
}
// 审核记录
ReviewLog reviewLog = reviewLogService.getReviewLog(id);
if (reviewLog != null) {
uiModel.addAttribute("reviewLog", reviewLog);
}
Map param = new HashMap();
// 设置查询条件,选择属于当前用户,当前企业的订单
param.put("id", id);
// param.put("userinfoid", userInfo.getId());
// param.put("enterpriseid", enterprise.getId());
List<Map> billAll = sqlSession.selectList("com.itrus.portal.db.BillMapper.selectProductBillCertById", param);
if (0 == billAll.size()) {
return ComNames.DENG_LU_CLIENT;
}
uiModel.addAttribute("bills", billAll.get(0));
// 获取数字证书
Product product = productService.getProduct((Long) billAll.get(0).get("product"));
DigitalCert digitalCert = digitalCertService.getDigitalCert(product.getCert());
// 获取订单在线支付方式
if (billAll.get(0).get("on_pay_info") != null) {
Map<Long, OnPayInfo> opiMap = sqlSession.selectMap("com.itrus.portal.db.OnPayInfoMapper.selectByExample", "id");
uiModel.addAttribute("opiMap", opiMap);
Map<Long, OnlinePay> opMap = sqlSession.selectMap("com.itrus.portal.db.OnlinePayMapper.selectByExample", "id");
uiModel.addAttribute("opMap", opMap);
}
PayInfoExample payInfoex = new PayInfoExample();
Map<Long, PayInfo> payinfoMap = sqlSession.selectMap("com.itrus.portal.db.PayInfoMapper.selectByExample", payInfoex, "id");
uiModel.addAttribute("payinfomap", payinfoMap);
// 获取产品规格
ProductSpec productSpec = null;
if (null != billAll.get(0).get("product_spec") && !"0".equals(billAll.get(0).get("product_spec"))) {
productSpec = productSpecService.getProductSpec((Long) billAll.get(0).get("product_spec"));
}
uiModel.addAttribute("productSpec", productSpec);
uiModel.addAttribute("digitalCert", digitalCert);
// 返回订单对应的老证书的base64
CertBuf certBuf = sqlSession.selectOne("com.itrus.portal.db.CertBufMapper.selectCertBufByBillId", id);
if (null != certBuf) {
uiModel.addAttribute("oldCertB64", certBuf.getCertBuf().replaceAll("\n", ""));
}
// 判断是否有签章服务,有则显示授权
if (null != product.getMakeSealServer()) {
uiModel.addAttribute("makesealserver", product.getMakeSealServer());
uiModel.addAttribute("billId", billAll.get(0).get("id"));
// 签章服务配置
List<MakeSealConfig> makeSealConfigs = sqlSession.selectList("com.itrus.portal.db.MakeSealConfigMapper.selectByExample");
if (!makeSealConfigs.isEmpty()) {
MakeSealConfig makeSealConfig = makeSealConfigs.get(0);
try {
makeSealConfig.setAddressKey(AESencrp.decrypt(makeSealConfig.getAddressKey(), dbEncKey));
} catch (EncDecException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
uiModel.addAttribute("makeSealConfig", makeSealConfig);
}
}
return "clientFW/dingdanxiangqing_gengxinqueren";
}
use of com.itrus.portal.db.Enterprise in project portal by ixinportal.
the class RenewUserCertClientController method toPages.
/**
* 跳转到更新成功页面或是更新失败页面 certs为新证书,若不为空则更新成功,若为空则更新失败 szy 2016年9月7日 上午9:49:15
*
* @param id
* 订单编号
*/
@RequestMapping(value = "/toPages/{id}", produces = "text/html")
public String toPages(@PathVariable("id") Long id, @RequestParam(value = "ret", required = false) int ret, HttpServletRequest request, Model uiModel) {
HttpSession session = request.getSession();
UserInfo userInfo = (UserInfo) session.getAttribute(ComNames.WEB_USER_INFO);
Enterprise enterprise = (Enterprise) session.getAttribute(ComNames.WEB_ENTERPRISE);
if (null == userInfo || null == enterprise) {
return ComNames.DENG_LU_CLIENT;
}
Map<String, Object> param = new HashMap<String, Object>();
// 设置查询条件,选择属于当前用户,当前企业的订单
param.put("id", id);
List<Map<String, Object>> billAll = sqlSession.selectList("com.itrus.portal.db.BillMapper.selectProductBillCertById", param);
if (0 == billAll.size()) {
uiModel.addAttribute("errorMsg", "更新订单不存在");
return ComNames.CLIENTFW_ERRORPAGE;
}
// 审核记录
ReviewLog reviewLog = reviewLogService.getReviewLog(id);
if (reviewLog != null) {
uiModel.addAttribute("reviewLog", reviewLog);
}
uiModel.addAttribute("bills", billAll.get(0));
if (billAll.get(0).get("on_pay_info") != null) {
Map<Long, OnPayInfo> opiMap = sqlSession.selectMap("com.itrus.portal.db.OnPayInfoMapper.selectByExample", "id");
uiModel.addAttribute("opiMap", opiMap);
}
PayInfoExample payInfoex = new PayInfoExample();
Map<Long, PayInfo> payinfoMap = sqlSession.selectMap("com.itrus.portal.db.PayInfoMapper.selectByExample", payInfoex, "id");
uiModel.addAttribute("payinfomap", payinfoMap);
UserCertExample uce = new UserCertExample();
UserCertExample.Criteria ucec = uce.or();
ucec.andBillEqualTo(id);
List<UserCert> certs = sqlSession.selectList("com.itrus.portal.db.UserCertMapper.selectByExample", uce);
if (ret == 1) {
// 更新成功页面
UserCert userCert = certs.get(0);
uiModel.addAttribute("doneTime", userCert.getCertStartTime());
try {
// 将客户端更新后的证书绑定给当前用户
userCert.setUserinfo(userInfo.getId());
userCertService.updateByPrimaryKeySelective(userCert);
} catch (Exception e) {
// TODO: handle exception
}
// 刷新session中的当前证书
session.setAttribute(ComNames.WEB_USER_CERT_SN, userCert.getCertSn());
return "clientFW/dingdanxiangqing_gengxinchenggong";
} else {
// 更新失败页面
return "clientFW/dingdanxiangqing_gengxinshibai";
}
}
use of com.itrus.portal.db.Enterprise in project portal by ixinportal.
the class ExtraBillWebController method showDetail.
/**
* 增值订单详细接口
*
* @param id
* @param processProgress 服务提供商
* 1默认进度,2为内嵌页面
* @param uiModel
* @param request
* @return
*/
@RequestMapping(value = "/bill/{id}.html", produces = "text/html")
public String showDetail(@PathVariable("id") Long id, @RequestParam(value = "processProgress", required = false) Long processProgress, Model uiModel, HttpServletRequest request) {
HttpSession session = request.getSession();
Enterprise enterprise = (Enterprise) session.getAttribute("webenterprise");
UserInfo userInfo = (UserInfo) session.getAttribute("webuserInfo");
ExtraBill bill = extraBillService.selectByPrimaryKey(id);
if (null == bill) {
uiModel.addAttribute("errorMsg", "订单不存在");
return "client/errorpage";
}
uiModel.addAttribute("bill", bill);
if (!bill.getUniqueId().equals(userInfo.getId())) {
uiModel.addAttribute("errorMsg", "您无权操作该订单");
return "client/errorpage";
}
// 订单对应的产品信息
ExtraProduct product = extraProductService.selectByPrimaryKey(bill.getExtraProduct());
uiModel.addAttribute("product", product);
// 订单对应的规格信息
ExtraProductSpec productSpec = extraProductSpecService.selectByPrimaryKey(bill.getExtraProductSpec());
uiModel.addAttribute("productSpec", productSpec);
// 银行卡支付记录信息
PayInfoExample payInfoex = new PayInfoExample();
Map<Long, PayInfo> payinfoMap = sqlSession.selectMap("com.itrus.portal.db.PayInfoMapper.selectByExample", payInfoex, "id");
uiModel.addAttribute("payinfomap", payinfoMap);
// 获取订单在线支付方式
if (null != bill.getOnPayInfo()) {
// 第三方在线支付记录信息
Map<Long, OnPayInfo> opiMap = sqlSession.selectMap("com.itrus.portal.db.OnPayInfoMapper.selectByExample", "id");
uiModel.addAttribute("opiMap", opiMap);
// 在线支付方式配置,目前有微信和支付宝两种
Map<Long, OnlinePay> opMap = sqlSession.selectMap("com.itrus.portal.db.OnlinePayMapper.selectByExample", "id");
uiModel.addAttribute("opMap", opMap);
}
// 电子发票信息
if (null != bill.geteInvoice()) {
Einvoice einvoice = sqlSession.selectOne("com.itrus.portal.db.EinvoiceMapper.selectByPrimaryKey", bill.geteInvoice());
uiModel.addAttribute("einvoice", einvoice);
}
// 纸票模版
Map<Long, Receipt> receiptmap = sqlSession.selectMap("com.itrus.portal.db.ReceiptMapper.selectByExample", null, "id");
uiModel.addAttribute("receiptmap", receiptmap);
// 电票开票模版
Map<Long, Ereceipt> ereceiptmap = sqlSession.selectMap("com.itrus.portal.db.EreceiptMapper.selectByExample", null, "id");
uiModel.addAttribute("ereceiptmap", ereceiptmap);
// 企业
Enterprise billEnterprise = sqlSession.selectOne("com.itrus.portal.db.EnterpriseMapper.selectByPrimaryKey", bill.getEnterprise());
if (StringUtils.isNotBlank(billEnterprise.getProvince())) {
String province = sysRegionService.getProvince(billEnterprise.getProvince());
billEnterprise.setProvince(province);
}
if (StringUtils.isNotBlank(billEnterprise.getCity())) {
String city = sysRegionService.getCity(billEnterprise.getCity());
billEnterprise.setCity(city);
}
uiModel.addAttribute("enterprise", billEnterprise);
// 开户行信息
OpenBankInfo openBankInfo = openBankInfoService.getOpenBankInfoByExtraBillId(id, null);
uiModel.addAttribute("openBankInfo", openBankInfo);
// 根据订单所处状态,返回不同的页面,或者先统一用一个页面.
if (processProgress != null && processProgress.intValue() == 2) {
return "client/banlijindu_neiqian";
}
return "client/banlijindu_moren";
}
Aggregations