use of com.itrus.portal.db.BankcardInfo in project portal by ixinportal.
the class BankCertificationController method verifyCode.
/**
* 验证动态码/银行卡认证处理
*
* @param mPhone
* @param code
* @param request
* @return
*/
@RequestMapping(value = "/verifyCode")
@ResponseBody
public Map<String, Object> verifyCode(@RequestHeader("Content-Signature") String authHmac, @RequestParam(value = "personId", required = false) Long personId, @RequestParam(value = "productId", required = false) Long productId, @RequestParam(value = "mPhone", required = true) String mPhone, @RequestParam(value = "code", required = true) String code, @RequestParam(value = "personName", required = true) String personName, @RequestParam(value = "personNo", required = true) String personNo, @RequestParam(value = "bankNo", required = true) String bankNo, HttpServletRequest request) {
// 得到当前个人用户信息
HttpSession session = request.getSession();
PersonInfo personInfo = (PersonInfo) session.getAttribute("webuserInfo");
// PersonInfo personInfo =personInfoService.getSelectById(personId);
// 得到当前产品信息
Product product = productService.getProductById(productId);
// 判断是否已经存在订单
List list = personalBillService.selectPersonalBillByPersonId(2, personId, productId, 8);
PersonalBill personalBill = null;
if (list.size() == 0) {
// 产生新订单
personalBill = personalBillService.saveBill(personId, personInfo.getmPhone(), productId, 2, product.getProject(), 1, product.getPrice(), personId, 3);
} else {
personalBill = (PersonalBill) list.get(0);
}
Map<String, Object> retMap = new HashMap<String, Object>();
// 0标识处理失败,1标识成功
retMap.put("retCode", 0);
try {
// 验证动态码,
if (!dynamicCodeService.verifyCode(mPhone, code)) {
// if(false){
// 验证码不通过
retMap.put("retMsg", "动态码验证失败");
return retMap;
} else {
// 调用银行卡认证
String str = pbankrealtestsms(authHmac, personName, personNo, bankNo, mPhone, "1");
retMap.put("retCode", 1);
JSONObject jasonObject = JSONObject.parseObject(str);
Map map = (Map) jasonObject;
String status = (String) map.get("status");
PersonInfo personInfo1 = personInfoService.getSelectById(personInfo.getId());
if ("200".equals(status)) {
retMap.put("retCode", 1);
// 添加银行卡信息
BankcardInfo bank = bankcardInfoService.saveBankcardInfo(personName, mPhone, personNo, bankNo, personId, null);
// 认证成功修改订单信息
personalBill.setReservedPhone(mPhone);
personalBill.setBankNo(bankNo);
personalBill.setRealName(personName);
personalBill.setIdCode(personNo);
personalBill.setBillStatus(8);
personalBill.setCheckTime(new Date());
personalBillService.updateByPersonalBill(personalBill);
// 修改个人用户信息
personInfo1.setRealName(personName);
personInfo1.setPersonName(personName);
personInfo1.setIdCode(personNo);
personInfoService.updateByPersonInfo(personInfo1);
// 生成认证记录
personalReviewLogService.saveReviewLog(1, null, 1, null, personalBill.getId(), personId, bank.getId());
// 添加系统日志
LogUtil.syslog(sqlSession, "银行卡认证送审成功", "产品ID" + personalBill.getProduct() + "订单ID:" + personalBill.getBillId());
} else {
if ("201".equals(status)) {
retMap.put("retMsg", map.get("message"));
} else if ("205".equals(status)) {
retMap.put("retMsg", map.get("error"));
}
// 认证失败修改订单状态
personalBill.setBillStatus(4);
personalBillService.updateByPersonalBill(personalBill);
// 生成认证记录
personalReviewLogService.saveReviewLog(1, null, 2, map.get("error").toString(), personalBill.getId(), personId, null);
// 添加系统日志
LogUtil.syslog(sqlSession, "银行卡认证送审失败", "产品ID" + personalBill.getProduct() + "订单ID:" + personalBill.getBillId());
}
}
} catch (Exception e) {
retMap.put("retMsg", "出现未知异常,请联系管理员处理");
String info = mPhone + "认证失败,原因:" + e.getMessage();
LogUtil.syslog(sqlSession, "银行卡认证", info);
return retMap;
}
return retMap;
}
use of com.itrus.portal.db.BankcardInfo in project portal by ixinportal.
the class BankcardInfoServiceImpl method saveBankcardInfo.
/**
* 生成银行卡信息
* @return
*/
public BankcardInfo saveBankcardInfo(String personName, String phone, String personNo, String bankNo, Long personId, String bankName) {
BankcardInfo bank = new BankcardInfo();
bank.setPersonName(personName);
bank.setPhone(phone);
bank.setPersonNo(personNo);
bank.setBankNo(bankNo);
bank.setUniqueId(personId);
bank.setCheckTime(new Date());
bank.setCreateTime(new Date());
bank.setCreator(personId);
bank.setBankName(bankName);
sqlSession.insert("com.itrus.portal.db.BankcardInfoMapper.insert", bank);
sqlSession.flushStatements();
return bank;
}
use of com.itrus.portal.db.BankcardInfo in project portal by ixinportal.
the class BankCertificationController method pbankrealtestsms.
// 个人银行卡认证接口(三要素)
@RequestMapping("/verify")
@ResponseBody
public Map<String, Object> pbankrealtestsms(@RequestHeader("Content-Signature") String authHmac, @RequestParam(value = "personId", required = false) Long personId, @RequestParam(value = "productId", required = false) Long productId, @RequestParam(value = "personName", required = true) String personName, @RequestParam(value = "personNo", required = true) String personNo, @RequestParam(value = "bankNo", required = true) String bankNo, HttpServletRequest request) throws Exception {
// 得到当前个人用户信息
HttpSession session = request.getSession();
PersonInfo personInfo = (PersonInfo) session.getAttribute("webuserInfo");
// 得到当前产品信息
Product product = productService.getProductById(productId);
Map<String, Object> retMap = new HashMap<String, Object>();
// 0标识发送验证码失败,1标识成功
retMap.put("retCode", 0);
// 判断是否已经存在订单
List list = personalBillService.selectPersonalBillByPersonId(2, personId, productId, 8);
PersonalBill personalBill = null;
try {
if (list.size() == 0) {
// 产生新订单
personalBill = personalBillService.saveBill(personId, personInfo.getmPhone(), productId, 2, product.getProject(), 1, product.getPrice(), personId, 3);
} else {
personalBill = (PersonalBill) list.get(0);
}
// 调用银行卡认证接口
String appId = sysconfigService.getPersonAppid();
String personUrl = sysconfigService.getPersonUrl();
String str = personalService.pbankreal(authHmac, appId, personName, personNo, bankNo, personUrl);
JSONObject jasonObject = JSONObject.parseObject(str);
Map map = (Map) jasonObject;
String status = (String) map.get("status");
PersonInfo personInfo1 = personInfoService.getSelectById(personInfo.getId());
if ("200".equals(status)) {
retMap.put("retCode", 1);
// 添加银行卡信息
BankcardInfo bank = bankcardInfoService.saveBankcardInfo(personName, null, personNo, bankNo, personId, null);
// 认证成功修改订单信息
personalBill.setBankNo(bankNo);
personalBill.setRealName(personName);
personalBill.setBillStatus(8);
personalBill.setIdCode(personNo);
personalBill.setCheckTime(new Date());
personalBillService.updateByPersonalBill(personalBill);
// 修改个人用户信息
personInfo1.setRealName(personName);
personInfo1.setPersonName(personName);
personInfo1.setIdCode(personNo);
personInfoService.updateByPersonInfo(personInfo1);
// 生成认证记录
personalReviewLogService.saveReviewLog(1, null, 1, null, personalBill.getId(), personId, bank.getId());
// 添加系统日志
LogUtil.syslog(sqlSession, "银行卡认证送审成功", "产品ID" + personalBill.getProduct() + "订单ID:" + personalBill.getBillId());
} else {
if ("201".equals(status)) {
retMap.put("retMsg", map.get("message"));
} else if ("205".equals(status)) {
retMap.put("retMsg", map.get("error"));
}
// 添加系统日志
LogUtil.syslog(sqlSession, "银行卡认证送审失败", "产品ID" + personalBill.getProduct() + "订单ID:" + personalBill.getBillId());
// 认证失败修改订单状态
personalBill.setBillStatus(4);
personalBillService.updateByPersonalBill(personalBill);
// 生成认证记录
personalReviewLogService.saveReviewLog(1, null, 2, map.get("message").toString(), personalBill.getId(), personId, null);
}
} catch (Exception e) {
// TODO: handle exception
retMap.put("retMsg", "出现未知异常,请联系管理员处理");
String info = personName + "认证失败,原因:" + e.getMessage();
LogUtil.syslog(sqlSession, "银行卡认证", info);
return retMap;
}
return retMap;
}
Aggregations