master
Aokiso 7 years ago
parent 9a00f52a09
commit 7caeb6cc98

@ -8,8 +8,8 @@ import java.util.List;
@Mapper
public interface auditMapper {
@Select("select * from audit where checkNum = #{checkNum}")
public Audit selectAudioByCheckNum(long checkNum);
// @Select("select * from audit where checkNum = #{checkNum}")
// public Audit selectAudioByCheckNum(long checkNum);
@Select("select * from audit where userNum = #{userNum}")
public List<Audit> selectAuditByUserNum(long userNum);
@ -38,12 +38,12 @@ public interface auditMapper {
"#{contractNum},#{isSignContract},#{year},#{amount},#{applyTime})")
public void addAudit(Audit audits);
@Update("update audit set checkNum=#{checkNum},userNum=#{userNum}" +
",productNum=#{productNum},checkState=#{checkState},contractNum=#{contractNum}," +
"isSignContract=#{isSignContract},year=#{year},amount=#{amount}," +
"applyTime=#{applyTime}where checkNum=#{checkNum}")
public void updateAudit(Audit audits);
// @Update("update audit set checkNum=#{checkNum},userNum=#{userNum}" +
// ",productNum=#{productNum},checkState=#{checkState},contractNum=#{contractNum}," +
// "isSignContract=#{isSignContract},year=#{year},amount=#{amount}," +
// "applyTime=#{applyTime}where checkNum=#{checkNum}")
// public void updateAudit(Audit audits);
@Delete("delete from audit where checkNum=#{checkNum}")
public void deleteAudit(long checkNum);
// @Delete("delete from audit where checkNum=#{checkNum}")
// public void deleteAudit(long checkNum);
}

@ -10,8 +10,8 @@ public interface userMapper {
@Select("select * from user where userNum = #{userNum}")
public User selectUserByuserNum(long userNum);
@Select("select * from user where userName = #{userName}")
public User selectUserByuserName(String userName);
@Select("select userNum from user where userName = #{userName}")
public long selectUserByuserName(String userName);
@Select("select * from user where telephoneNum = #{telephoneNum}")
public User selectUserBytelephoneNum(String telephoneNum);

@ -5,7 +5,7 @@ import org.springframework.stereotype.Service;
@Service
public abstract class UserService {
public User selectUserByuserName(String userName){return null;}
public long selectUserByuserName(String userName){return 0;}
public User selectUserBytelephoneNum(String telephoneNum){return null;}
public void addUser(User users){}
public long count(){return 0;}

@ -13,7 +13,7 @@ public class UserServiceImpl extends UserService{
private userMapper UserMapper;
@Transactional(propagation=Propagation.REQUIRED,readOnly = true)
public User selectUserByuserName(String userName){
public long selectUserByuserName(String userName){
return this.UserMapper.selectUserByuserName(userName);
}
@Transactional(propagation=Propagation.REQUIRED,readOnly = true)

@ -1,5 +1,6 @@
package com.example.demo.loginService;
import com.example.demo.Dao.userMapper;
import com.example.demo.bean.User;
import com.example.demo.loginService.API.impl.UserServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
@ -20,6 +21,8 @@ import java.util.Date;
public class UserController extends HttpServlet {
@Autowired
private UserServiceImpl userServiceImpl;
@Autowired
private userMapper userMapper;
@PostMapping("/login")
//@ResponseBody
@ -27,12 +30,12 @@ public class UserController extends HttpServlet {
//System.out.println("_______________");
String userName = request.getParameter("userName");
String userPwd = request.getParameter("userPwd");
User user = this.userServiceImpl.selectUserByuserName(userName);
long usernum = this.userServiceImpl.selectUserByuserName(userName);
int result = 0;
if(user!=null){
if(user.getUserPwd().equals(userPwd)){
if(usernum!=1){
if(userMapper.selectPwd(usernum,userPwd)==1){
HttpSession session=request.getSession();
session.setAttribute("user",user);
session.setAttribute("user",usernum);
result = 1;
} else{
result = 2;
@ -51,10 +54,11 @@ public class UserController extends HttpServlet {
String userName = request.getParameter("userName");
String userPwd = request.getParameter("userPwd");
String userPwd1=request.getParameter("userPwd1");
User user = this.userServiceImpl.selectUserByuserName(userName);
long usernum = this.userServiceImpl.selectUserByuserName(userName);
User user=new User();
long count = 0;
int result = 0;
if(user!=null){
if(usernum!=1){
result = 2;
}else if(userPwd.equals(userPwd1)){
count = this.userServiceImpl.count()+1;

@ -21,17 +21,15 @@ public class bankCardController extends HttpServlet {
@RequestMapping("/binding")//卡号绑定界面
public void doPost(HttpServletResponse response, HttpServletRequest request)throws IOException {
HttpSession session=request.getSession();
User user=new User();
user=(User)session.getAttribute("user");
long userNum=(long)session.getAttribute("user");
try{
long num=user.getUserNum();
short result=0;
UserBankIdentify userBankIdentify=new UserBankIdentify();
userBankIdentify.setBankAccount(request.getParameter("bankAccount"));
userBankIdentify.setTrueName(request.getParameter("realname"));
userBankIdentify.setIdNum(request.getParameter("idNum"));
userBankIdentify.setTelephoneNum(request.getParameter("phoneNum"));
userBankIdentify.setUserNum(num);
userBankIdentify.setUserNum(userNum);
userBankIdentify.setBankAccountIdentify(result);
identify.identify(userBankIdentify);
}catch (Exception e){

@ -19,10 +19,9 @@ public class pwdController extends HttpServlet {
@RequestMapping("/pwd")//再一次确认密码界面
public String doPost(HttpServletResponse response, HttpServletRequest request){
HttpSession session=request.getSession();
User user=new User();
user=(User)session.getAttribute("user");
long userNum=(long)session.getAttribute("user");
String pwd=request.getParameter("userPwd");
if(userMapper.selectPwd(user.getUserNum(),pwd)==1){
if(userMapper.selectPwd(userNum,pwd)==1){
return "";//银行卡验证的界面
}else{
return "";//登陆失败

Loading…
Cancel
Save