use of com.itrus.portal.db.UserInfo 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.UserInfo in project portal by ixinportal.
the class ExtraBillWebController method delete.
// 删除未支付订单
@RequestMapping(value = "/bill/{id}.html", method = RequestMethod.PUT, produces = "text/html")
@ResponseBody
public String delete(@PathVariable("id") Long id, @RequestParam(value = "page", required = false) Integer page, @RequestParam(value = "size", required = false) Integer size, HttpServletRequest request, Model uiModel) {
ExtraBill bill = extraBillService.selectByPrimaryKey(id);
HttpSession session = request.getSession();
UserInfo userInfo = (UserInfo) session.getAttribute("webuserInfo");
if (null == userInfo) {
return "登录失效,请重新登录";
}
if (bill == null) {
return "未找到要删除订单";
} else {
if (!bill.getUniqueId().equals(userInfo.getId())) {
return "您无权操作改订单";
}
if (!bill.getBillStatus().equals(ComNames.EXTRA_BILL_STATUS_1)) {
return "该订单不允许删除";
}
bill.setIsDelete(true);
try {
extraBillService.updateByPrimaryKeySelective(bill);
UserLog userlog = new UserLog();
userlog.setProject(userInfo.getProject());
userlog.setType("删除增值订单");
userlog.setInfo(userInfo.getmPhone() + "删除了订单" + bill.getBillId());
userlog.setHostId("未知");
userlog.setSn(null == userInfo.getUniqueId() ? null : userInfo.getUniqueId());
LogUtil.userlog(sqlSession, userlog);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
return null;
}
use of com.itrus.portal.db.UserInfo 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";
}
use of com.itrus.portal.db.UserInfo in project portal by ixinportal.
the class PayWebController method returnUrl.
/**
* 客户页面跳转的页面(客户自己的页面)
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/returnUrl")
public String returnUrl(HttpServletRequest request, Model uiModel, HttpServletResponse response) {
HttpSession session = request.getSession();
UserInfo userInfo = (UserInfo) session.getAttribute("webuserInfo");
if (null != userInfo) {
userInfo = userInfoService.getUserInfoById(userInfo.getId());
session.setAttribute("webuserInfo", userInfo);
if (null != userInfo.getProject()) {
EnterpriseQqExample enterprise = new EnterpriseQqExample();
EnterpriseQqExample.Criteria qqEx = enterprise.createCriteria();
qqEx.andProjectIdEqualTo(userInfo.getProject());
EnterpriseQq enterpriseqq = sqlSession.selectOne("com.itrus.portal.db.EnterpriseQqMapper.selectByExample", enterprise);
if (enterpriseqq != null && enterpriseqq.getEnterpriseQqLinks() != null) {
uiModel.addAttribute("enterpriseqq", enterpriseqq.getEnterpriseQqLinks());
session.setAttribute("enterpriseqqE", enterpriseqq.getEnterpriseQqLinks());
}
}
}
return "ixinweb/zhifuchenggong";
}
use of com.itrus.portal.db.UserInfo in project portal by ixinportal.
the class MakeCertController method push.
/**
* 手动推送
*
* @param id
* @param uiModel
* @return
*/
@RequestMapping(value = "/{id}/{type}", method = RequestMethod.GET, produces = "text/html")
@ResponseBody
public String push(@PathVariable("id") Long id, @PathVariable("type") Long type, Model uiModel) {
SignatureConfig sc = null;
JSONObject data = null;
JSONObject org = null;
JSONObject result = null;
Bill bill = null;
/*if(type==1){
try {
bill = sqlSession.selectOne("com.itrus.portal.db.BillMapper.selectByPrimaryKey", id);
log.error("bill.getMcstatus()="+bill.getMcstatus()+"bill="+bill);
if(null == bill) {
//log.error(bill.getMcstatus()+"---------------------------------------------"+bill);
//System.out.println(bill.getMcstatus()+"=******************************="+bill);
return "该订单无法推送";
}
Product product = productService.getProductById(bill.getProduct());
sc = sqlSession.selectOne("com.itrus.portal.db.SignatureConfigMapper.selectByPrimaryKey",
product.getSignature());
Enterprise enterprise = enterpriseService.getEnterpriseByBillId(id);
BusinessLicense bl = businessService.getBusinessByBillId((id), null);
if (org == null) {
org = new JSONObject();
}
org.put("userType", 1);
org.put("fullName", bl.getEnterpriseName());
if (bl != null && bl.getBusinessType() == 1) {
org.put("orgCode", bl.getLicenseNo());
} else {
TaxRegisterCert tc = taxCertService.getTaxRegisterCertByBillId((id), null);
org.put("orgCode", tc == null ? "" : tc.getCertNo());
}
org.put("papersType", "营业执照");
UserInfo userInfo = sqlSession.selectOne("com.itrus.portal.db.UserInfoMapper.selectByPrimaryKey",
bill.getUniqueId());
org.put("businessNum", userInfo.getTelephone());
// IdentityCard ic =
// identityCardService.getIdentityCardByBillId(Long.parseLong(String.valueOf(map.get("id"))),
// null);
org.put("legalPersonName", bl == null ? "" : bl.getLegalPerson());
Agent agent = agentService.getAgentByBillId((id), null);
org.put("transactorName", agent == null ? enterprise.getEnterpriseName() : agent.getName());
if (agent != null && agent.getCardType() == 1) {
org.put("transactorIdCardNum", agent.getIdCode());
}
org.put("transactorMobile", userInfo.getmPhone());
org.put("realInfoOrder", bill.getBillId());
org.put("realInfoUid", bill.getUniqueId());
if (data == null) {
data = new JSONObject();
}
data.put("appId", sc.getAppId());
data.put("timestamp", System.currentTimeMillis());
data.put("user", org);
data.put("autoCert", true);
data.put("autoSeal", true);
// String content =
// "{\"autoCert\":true,\"timestamp\":1472105170418,\"apiId\":\"test\",\"autoSeal\":true,\"user\":{\"transactorIdCardNum\":\"120102198904025625\",\"transactorMobile\":\"15822452770\",\"orgCode\":\"120116328553325\",\"papersType\":\"营销执照\",\"businessNum\":\"022-88956296\",\"realInfoUid\":\"151\",\"fullName\":\"天津瑞普生物技术股份有限公司空港经济区分公司\",\"legalPersonName\":\"刘建\",\"transactorName\":\"李洋\",\"realInfoOrder\":\"TWCX20160824170928580820\",\"userType\":1}}";
// bill =
// sqlSession.selectOne("com.itrus.portal.db.BillMapper.selectByPrimaryKey",
// map.get("id"));
if (bill.getMcstatus() != null && bill.getMcstatus() == 1) {
// return "redirect:/makecert";
return null;
}
log.error("打印data="+data.toString());
log.error("----------接口地址**************"+sc.getAddress() + USER_URL+"***********服务密钥**********"+sc.getAddressKey());
result = JSONObject
.parseObject(RequestUtils.post(sc.getAddress() + USER_URL, data.toString(), sc.getAddressKey()));
log.equals("MakeCert_push_result : " + result);
if (result.getBoolean("isOK") && result.getIntValue("code") == 0) {
LogUtil.syslog(sqlSession, "手动推送用户", bill.getBillId() + "企业名称:" + bl.getEnterpriseName());
bill.setMcstatus(1);
bill.setBillStatus(8);
sqlSession.update("com.itrus.portal.db.BillMapper.updateByPrimaryKey", bill);
sqlSession.flushStatements();
// return "redirect:/makecert";
return null;
}
LogUtil.syslog(sqlSession, "手动推送用户",
bill.getBillId() + "企业名称:" + enterprise.getEnterpriseName() + "错误:" + result.getString("message"));
// uiModel.addAttribute("error", "错误:" +
// result.getString("message"));
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
// uiModel.addAttribute("error", "错误:" + e);
return "错误【" + e + "】";
}
}else */
if (type == 1) {
try {
bill = sqlSession.selectOne("com.itrus.portal.db.BillMapper.selectByPrimaryKey", id);
log.error("bill.getMcstatus()=" + bill.getMcstatus() + "bill=" + bill);
if (null == bill) {
// System.out.println(bill.getMcstatus()+"=******************************="+bill);
return "该订单无法推送";
}
Product product = productService.getProductById(bill.getProduct());
sc = sqlSession.selectOne("com.itrus.portal.db.SignatureConfigMapper.selectByPrimaryKey", product.getSignature());
Enterprise enterprise = enterpriseService.getEnterpriseByBillId(id);
BusinessLicense bl = businessService.getBusinessByBillId((id), null);
if (org == null) {
org = new JSONObject();
}
org.put("userType", 1);
org.put("fullName", bl.getEnterpriseName());
if (bl != null && bl.getBusinessType() == 1) {
org.put("orgCode", bl.getLicenseNo());
} else {
TaxRegisterCert tc = taxCertService.getTaxRegisterCertByBillId((id), null);
org.put("orgCode", tc == null ? "orgCode" : tc.getCertNo());
}
org.put("papersType", "营业执照");
UserInfo userInfo = sqlSession.selectOne("com.itrus.portal.db.UserInfoMapper.selectByPrimaryKey", bill.getUniqueId());
org.put("businessNum", userInfo.getTelephone() == null ? "businessNum" : userInfo.getTelephone());
// null);
if (bl != null) {
org.put("legalPersonName", bl.getLegalPerson() == null ? "legalPersonName" : bl.getLegalPerson());
} else {
org.put("legalPersonName", "legalPersonName");
}
Agent agent = agentService.getAgentByBillId((id), null);
org.put("transactorName", agent == null ? "transactorName" : agent.getName());
if (agent != null && agent.getCardType() == 1) {
org.put("transactorIdCardNum", agent.getIdCode());
} else {
org.put("transactorIdCardNum", "transactorIdCardNum");
}
org.put("transactorMobile", userInfo.getmPhone());
org.put("realInfoOrder", bill.getBillId());
org.put("realInfoUid", bill.getUniqueId());
if (data == null) {
data = getJSONRequest(sc.getAppId());
}
data.put("autoCert", true);
data.put("autoSeal", true);
// data.put("appId", sc.getAppId());
// data.put("timestamp", System.currentTimeMillis());
data.put("user", org);
// String content =
// "{\"autoCert\":true,\"timestamp\":1472105170418,\"apiId\":\"test\",\"autoSeal\":true,\"user\":{\"transactorIdCardNum\":\"120102198904025625\",\"transactorMobile\":\"15822452770\",\"orgCode\":\"120116328553325\",\"papersType\":\"营销执照\",\"businessNum\":\"022-88956296\",\"realInfoUid\":\"151\",\"fullName\":\"天津瑞普生物技术股份有限公司空港经济区分公司\",\"legalPersonName\":\"刘建\",\"transactorName\":\"李洋\",\"realInfoOrder\":\"TWCX20160824170928580820\",\"userType\":1}}";
// bill =
// sqlSession.selectOne("com.itrus.portal.db.BillMapper.selectByPrimaryKey",
// map.get("id"));
/*if (bill.getMcstatus() != null && bill.getMcstatus() == 1) {
// return "redirect:/makecert";
return null;
}*/
log.error("打印data=" + data.toString());
log.error("----------接口地址**************" + sc.getAddress() + USER_URL + "***********服务密钥**********" + sc.getAddressKey());
result = JSONObject.parseObject(RequestUtils.post(sc.getAddress() + USER_URL, data.toString(), sc.getAddressKey()));
log.equals("MakeCert_push_result : " + result);
if (result.getBoolean("isOK") && result.getIntValue("code") == 0) {
LogUtil.syslog(sqlSession, "手动推送用户", bill.getBillId() + "企业名称:" + bl.getEnterpriseName());
bill.setMcstatus(1);
bill.setBillStatus(8);
sqlSession.update("com.itrus.portal.db.BillMapper.updateByPrimaryKey", bill);
sqlSession.flushStatements();
// return "redirect:/makecert";
return null;
}
LogUtil.syslog(sqlSession, "手动推送用户", bill.getBillId() + "企业名称:" + enterprise.getEnterpriseName() + "错误:" + result.getString("message"));
// uiModel.addAttribute("error", "错误:" +
// result.getString("message"));
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
// uiModel.addAttribute("error", "错误:" + e);
return "错误【" + e + "】";
}
} else {
try {
bill = sqlSession.selectOne("com.itrus.portal.db.BillMapper.selectByPrimaryKey", id);
log.error("bill.getMcstatus()=" + bill.getMcstatus() + "bill=" + bill);
if (null == bill) {
// System.out.println(bill.getMcstatus()+"=******************************="+bill);
return "该订单无法推送";
}
Product product = productService.getProductById(bill.getProduct());
sc = sqlSession.selectOne("com.itrus.portal.db.SignatureConfigMapper.selectByPrimaryKey", product.getSignature());
Enterprise enterprise = enterpriseService.getEnterpriseByBillId(id);
BusinessLicense bl = businessService.getBusinessByBillId((id), null);
/*if (org == null) {
org = new JSONObject();
}
org.put("userType", 1);
org.put("fullName", bl.getEnterpriseName());
if (bl != null && bl.getBusinessType() == 1) {
org.put("orgCode", bl.getLicenseNo());
} else {
TaxRegisterCert tc = taxCertService.getTaxRegisterCertByBillId((id), null);
org.put("orgCode", tc == null ? "" : tc.getCertNo());
}
org.put("papersType", "营业执照");*/
UserInfo userInfo = sqlSession.selectOne("com.itrus.portal.db.UserInfoMapper.selectByPrimaryKey", bill.getUniqueId());
// org.put("businessNum", userInfo.getTelephone());
// IdentityCard ic =
// identityCardService.getIdentityCardByBillId(Long.parseLong(String.valueOf(map.get("id"))),
// null);
// org.put("legalPersonName", bl == null ? "" : bl.getLegalPerson());
Agent agent = agentService.getAgentByBillId((id), null);
/*org.put("transactorName", agent == null ? "" : agent.getName());
if (agent != null && agent.getCardType() == 1) {
org.put("transactorIdCardNum", agent.getIdCode());
}
org.put("transactorMobile", userInfo.getmPhone());
org.put("realInfoOrder", bill.getBillId());
org.put("realInfoUid", bill.getUniqueId());*/
if (data == null) {
data = new JSONObject();
}
Map<String, Object> treeMap = Maps.newTreeMap();
treeMap.put("app_id", sc.getAppId());
treeMap.put("order_number", bill.getBillId());
treeMap.put("user_name", enterprise.getEnterpriseName());
treeMap.put("user_email", userInfo.getEmail());
treeMap.put("user_phone", userInfo.getmPhone());
treeMap.put("user_type", "organization");
/*String cardType = null;
if(agent!=null && agent.getCardType()!=null){
if(agent.getCardType()==1){
cardType = "IdentityCard";
}else if(agent.getCardType()==2){
cardType = "NationalPassport";
}else{
cardType = "Other";
}
treeMap.put("identification_number",agent.getIdCode());
}
*/
String cardType = null;
String sn = null;
BusinessLicense businessLicense = businessService.getBusinessByBillId(bill.getId(), null);
if (businessLicense != null && businessLicense.getBusinessType() == 1) {
sn = businessLicense.getLicenseNo();
cardType = "UniformSocialCreditCode";
}
if (businessLicense == null || businessLicense.getBusinessType() != 1) {
// 不是五证合一
OrgCode oc = orgCodeService.getOrgCodeByBillId(bill.getId(), null);
if (oc != null) {
sn = oc.getOrgCode();
cardType = "OrganizationCode";
}
}
treeMap.put("identification_number", sn);
treeMap.put("identity_type", cardType);
String jsondata = JSONObject.toJSONString(treeMap);
String data1 = mapToQueryString(treeMap);
log.error(data1);
result = JSONObject.parseObject(RequestUtils.post1(sc.getAddress(), jsondata.toString(), data1, sc.getAddressKey(), "HMAC-SHA256"));
log.equals("MakeCert_push_result : " + result);
if (result.getString("code") != null && "SUCCESS".equals(result.getString("code").toString())) {
LogUtil.syslog(sqlSession, "手动推送用户", bill.getBillId() + "企业名称:" + bl.getEnterpriseName());
bill.setMcstatus(1);
bill.setBillStatus(8);
sqlSession.update("com.itrus.portal.db.BillMapper.updateByPrimaryKey", bill);
sqlSession.flushStatements();
// return "redirect:/makecert";
return null;
}
LogUtil.syslog(sqlSession, "手动推送用户", bill.getBillId() + "企业名称:" + enterprise.getEnterpriseName() + "错误:" + result.getString("message"));
// uiModel.addAttribute("error", "错误:" +
// result.getString("message"));
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
// uiModel.addAttribute("error", "错误:" + e);
return "错误【" + e + "】";
}
}
return "错误【" + result.getString("message") + "】";
}
Aggregations