master
Aokiso 7 years ago
parent 9a00f52a09
commit 7caeb6cc98

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

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

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

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

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

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

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

Loading…
Cancel
Save