package com.dao.impl;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import javax.mail.Folder;
import org.hibernate.Hibernate;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import com.dao.indexDao;
/**
* All rights Reserved, Designed By www.kanq.com.cn
* @Title: index.java
* @Package com.action
* @Description: TODO()
* @author: XXQ-PC
* @date: 201710231:19:25
* @version V1.0
* @Copyright: 2017 www.kanq.com.cn Inc. All rights reserved.
*
*/
public class indexDaoImpl extends HibernateDaoSupport implements indexDao{
public List<Object[]> index(String userId,String userPwd){
Session session=null;
Query query = null;
List<Object[]> list = null;
try {
session = this.getSessionFactory().openSession();
String sql ="select count(*) as con from admin_user where userid='"+userId+"' and userpwd='"+userPwd+"' ";
query = session.createSQLQuery(sql)
.addScalar("con", Hibernate.STRING);
list = query.list();
} catch (Exception e) {
e.printStackTrace();
} finally {
session.close();
}
return list;
}
public List<Object[]> zfblogin(String userId, String userPwd){
Session session=null;
Query query = null;
List<Object[]> list = null;
try {
session = this.getSessionFactory().openSession();
String sql ="select count(*) as con from zfb where userid='"+userId+"' and password='"+userPwd+"' ";
query = session.createSQLQuery(sql)
.addScalar("con", Hibernate.STRING);
list = query.list();
} catch (Exception e) {
e.printStackTrace();
} finally {
session.close();
}
return list;
}
@SuppressWarnings({ "null", "unchecked" })
public List<List> userLogin(String userId, String userPwd){
Session session=null;
Query query = null;
Query query1 = null;
List<Object[]> list = null;
List<Object[]> list1 = null;
List<List> list2 = new ArrayList<List>();
try {
session = this.getSessionFactory().openSession();
String sql ="select count(*) as con from user_kh where idcard='"+userId+"' and loginpwd='"+userPwd+"' ";
String sql1 ="select distinct username from user_kh where idcard='"+userId+"' and loginpwd='"+userPwd+"' ";
query = session.createSQLQuery(sql)
.addScalar("con", Hibernate.STRING);
query1 = session.createSQLQuery(sql1)
.addScalar("username", Hibernate.STRING);
list = query.list();
list1 = query1.list();
list2.add(list);
list2.add(list1);
} catch (Exception e) {
e.printStackTrace();
} finally {
session.close();
}
return list2;
}
public String register(String txtName, String txtIdCard, String txtBirthDate, String txtYhCard,
String txtJe, String sex, String txtDate, String txtAge, String cxkkind, String txtTel, String txtloginpwd,
String txtjypwd, String txtArea){
String flag = "开户成功";
Transaction tran = null;
Session session = this.getSessionFactory().openSession();
try {
tran = session.beginTransaction();
session.createSQLQuery("insert into user_kh values('"+txtName+"','"+txtIdCard+"','"+txtBirthDate+"','"+txtYhCard+"','"+txtJe+"','"+sex+"','"+txtDate+"','"+txtAge+"','"+cxkkind+"','"+txtTel+"','"+txtArea+"','"+txtloginpwd+"','"+txtjypwd+"','否')").executeUpdate();
tran.commit();
} catch (HibernateException e) {
tran.rollback();
e.printStackTrace();
}finally{
session.close();
}
return flag;
}
public String xyksq(String txtName, String txtIdCard, String txtYhCard, String txtDate, String txtxykz,
String txtxyed, String txtjypwd){
String flag = "信用卡申请成功!";
Transaction tran = null;
Session session = this.getSessionFactory().openSession();
try {
tran = session.beginTransaction();
session.createSQLQuery("insert into user_xyk values('"+txtName+"','"+txtIdCard+"','"+txtYhCard+"','"+txtDate+"','"+txtxykz+"','"+txtxyed+"','"+txtjypwd+"','审核中',0,'否')").executeUpdate();
tran.commit();
} catch (HibernateException e) {
tran.rollback();
e.printStackTrace();
}finally{
session.close();
}
return flag;
}
public String ck(String kz, String kh, String je){
int kz1=Integer.parseInt(kz);
String flag = "存款成功!";
Transaction tran = null;
Session session=null;
Query query = null;
List<Object[]> list = null;
session = this.getSessionFactory().openSession();
if(kz1==1||kz1==2){
try {
String sql ="select ycje from user_kh where yhcard='"+kh+"'";
query = session.createSQLQuery(sql)
.addScalar("ycje", Hibernate.STRING);
list = query.list();
String ycje=list.toString();
ycje=ycje.substring(1,ycje.length()-1);
float ycje1=Float.parseFloat(ycje);
float je1=Float.parseFloat(je);
float sumje=ycje1+je1;
tran = session.beginTransaction();
session.createSQLQuery("update user_kh set ycje='"+sumje+"' where yhcard='"+kh+"'").executeUpdate();
tran.commit();
} catch (HibernateException e) {
tran.rollback();
e.printStackTrace();
}finally{
session.close();
}
}
else{
try {
String sql ="select ye from user_xyk where yhcard='"+kh+"'";
query = session.createSQLQuery(sql)
.addScalar("ye", Hibernate.STRING);
list = query.list();
String ye=list.toString();
ye=ye.substring(1,ye.length()-1);
float ye1=Float.parseFloat(ye);
float je1=Float.parseFloat(je);
float sumje=ye1+je1;
tran = session.beginTransaction();
session.createSQLQuery("update user_xyk set ye='"+sumje+"' where yhcard='"+kh+"'").executeUpdate();
tran.commit();
} catch (HibernateException e) {
tran.rollback();
e.printStackTrace();
}finally{
session.close();
}
}
return flag;
}
public String zfbbd(String kh){
String flag = "绑定成功!";
Transaction tran = null;
Session session = this.getSessionFactory().openSession();
try {
tran = session.beginTransaction();
session.createSQLQuery("update user_kh set bdzfb='是' where yhcard='"+kh+"'").executeUpdate();
session.createSQLQuery("update user_xyk set bdzfb='是' where yhcard='"+kh+"'").executeUpdate();
tran.commit();
} catch (HibernateException e) {
tran.rollback();
e.printStackTrace();
}finally{
session.close();
}
return flag;
}
public String zz(String time, String zckh, String zckhye, String zrkh, String zrkhxm, String zzje,
String useridcard){
String flag = "转账成功!";
Transaction tran = null;
Session session=null;
Query query = null;
List<Object[]> list = null;
session = this.getSessionFactory().openSession();
try {
String sql ="select ycje from user_kh where yhcard='"+zrkh+"' and username='"+zrkhxm+"'";
query = session.createSQLQuery(sql)
.addScalar("ycje", Hibernate.STRING);
list = query.list();
String zrycje=list.toString();
zrycje=zrycje.substring(1,zrycje.length()-1);
float zrycje1=Float.parseFloat(zrycje);
float zcycje=Float.parseFloat(zckhye);
float zcje=Float.parseFloat(zzje);
float zcsumje=zcycje-zcje;
float zrsumje=zrycje1+zcje;
tran = session.beginTransaction();
session.createSQLQuery("update user_kh set ycje='"+zcsumje+"' where yhcard='"+zckh+"' and idcard='"+useridcard+"'").executeUpdate();
session.createSQLQuery("update user_kh set ycje='"+zrsumje+"' where yhcard='"+zrkh+"' and username='"+zrkhxm+"'").executeUpdate();
session.createSQLQuery("insert into zz values('"+zckh+"','"+zzje+"','"+zcsumje+"','"+zrkh+"','"+zrkhxm+"','"+time+"','"
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
基于ssh的个人银行账户管理系统的设计与实现,一整套,工程,数据库文件,word,ppt,直接运行,前后台,多种卡种,储蓄卡,黄山卡,信用卡申请,后台审批通过,绑定支付宝,html5特性,ajax
资源推荐
资源详情
资源评论
收起资源包目录
基于ssh的个人银行账户管理系统的设计与实现,一整套,工程,数据库文件,word,ppt,直接运行 (1168个子文件)
all-wcprops 2KB
all-wcprops 2KB
indexDaoImpl.class 21KB
index.class 12KB
indexServiceImpl.class 6KB
RegulatedCategoryUtil.class 6KB
UploadHandleServlet.class 6KB
indexDao.class 2KB
indexService.class 2KB
.classpath 888B
org.eclipse.wst.common.component 576B
org.eclipse.wst.jsdt.ui.superType.container 49B
ueditor.css 44KB
ueditor.min.css 34KB
video-js.css 21KB
image.css 19KB
ligerui-form.css 17KB
ligerui-grid.css 15KB
video.css 15KB
attachment.css 15KB
ligerui-dialog.css 14KB
video-js.min.css 11KB
form.css 9KB
form.css 9KB
form.css 9KB
grid.css 7KB
grid.css 7KB
ligerui-layout.css 7KB
grid.css 7KB
shCoreDefault.css 7KB
ligerui-tab.css 6KB
ligerui-attachment.css 6KB
ligerui-common.css 5KB
form.css 5KB
layout.css 5KB
layout.css 5KB
dialog.css 4KB
scrawl.css 4KB
tab.css 4KB
tab.css 4KB
ligerui-icons.css 3KB
dialog.css 3KB
dialog.css 3KB
fileUpload.css 3KB
ligerui-tree.css 3KB
codemirror.css 3KB
charts.css 3KB
background.css 2KB
grid.css 2KB
ligerui-menu.css 2KB
emotion.css 2KB
dialogbase.css 2KB
music.css 2KB
index.css 1KB
index.css 1KB
layout.css 1KB
tab.css 1KB
edittable.css 1KB
template.css 1KB
iconfont.css 1015B
ligerui-image.css 796B
webuploader.css 515B
common.css 480B
common.css 480B
help.css 395B
ligerui-all.css 350B
all.css 188B
all.css 163B
all.css 107B
style.css 81B
iframe.css 42B
dir-prop-base 33B
dir-prop-base 33B
部署要点.doc 275KB
个人银行账户管理系统论文.docx 4.43MB
entries 3KB
entries 3KB
iconfont.eot 7KB
vjs.eot 3KB
UEditorSnapscreen.exe 508KB
wface.gif 49KB
jxface2.gif 40KB
yface.gif 28KB
bface.gif 27KB
icons.gif 20KB
file-icons.gif 20KB
file-icons.gif 20KB
tface.gif 19KB
fface.gif 18KB
dialog-winbtns.gif 13KB
dialog-winbtns.gif 13KB
dialog-winbtns.gif 13KB
button-bg-over.gif 13KB
icon-unselect.gif 13KB
button-disabled.gif 13KB
button-over.gif 13KB
button-disabled.gif 13KB
button-over.gif 13KB
button-disabled.gif 13KB
button-over.gif 13KB
共 1168 条
- 1
- 2
- 3
- 4
- 5
- 6
- 12
资源评论
xxq121389527
- 粉丝: 322
- 资源: 42
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功