# Conflicts: # demo/src/main/java/com/example/demo/DemoApplication.javamaster
commit
883344b1ee
@ -0,0 +1,29 @@
|
|||||||
|
package com.example.demo.Dao;
|
||||||
|
|
||||||
|
import com.example.demo.bean.UserBankIdentify;
|
||||||
|
import org.apache.ibatis.annotations.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface userBankIdMapper {
|
||||||
|
@Select("select * from userBankIdentify where userNum = #{userNum}")
|
||||||
|
public UserBankIdentify selectUsageDateByCheckNum(long userNum);
|
||||||
|
|
||||||
|
@Select("select * from userBankIdentify")
|
||||||
|
public List<UserBankIdentify> select();
|
||||||
|
|
||||||
|
@Insert("insert into userBankIdentify(userNum, bankAccount,trueName," +
|
||||||
|
"idNum,telephoneNum, bankAccountIdentify)" +
|
||||||
|
" values (#{userNum},#{bankAccount},#{trueName}," +
|
||||||
|
"#{idNum},#{telephoneNum},#{bankAccountIdentify})")
|
||||||
|
public void addUserBankIdentify(UserBankIdentify userBankIdentifys);
|
||||||
|
|
||||||
|
@Update("update userBankIdentify set userNum=#{userNum },bankAccount=#{bankAccount}" +
|
||||||
|
",trueName=#{trueName},idNum=#{idNum},telephoneNum=#{telephoneNum}," +
|
||||||
|
"bankAccountIdentify=#{bankAccountIdentify}")
|
||||||
|
public void updateUserBankIdentify(UserBankIdentify userBankIdentifys);
|
||||||
|
|
||||||
|
@Delete("delete from userBankIdentify where userNum=#{userNum}")
|
||||||
|
public void deleteUserBankIdentify(long userNum);
|
||||||
|
}
|
@ -1,27 +0,0 @@
|
|||||||
package com.example.demo.Dao;
|
|
||||||
|
|
||||||
import com.example.demo.bean.UserBankIdentify;
|
|
||||||
import org.apache.ibatis.annotations.*;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Mapper
|
|
||||||
public interface userBankIdentify {
|
|
||||||
@Select("select * from userbankidentify where userName = #{userName}")
|
|
||||||
public UserBankIdentify selectUsageDateByCheckNum(String userName);
|
|
||||||
|
|
||||||
@Select("select * from userBankIdentify")
|
|
||||||
public List<UserBankIdentify> select();
|
|
||||||
|
|
||||||
@Insert("insert into usagedate(userName, bankAccount,trueName,idNum,telephoneNum, bankAccountIdentify)" +
|
|
||||||
" values (#{userName},#{bankAccount},#{bankAccountIdentify})")
|
|
||||||
public void addUserBankIdentify(UserBankIdentify userBankIdentifys);
|
|
||||||
|
|
||||||
@Update("update usagedate set userName=#{userName},bankAccount=#{bankAccount}" +
|
|
||||||
",trueName=#{trueName},idNum=#{idNum},telephoneNum=#{telephoneNum}," +
|
|
||||||
"bankAccountIdentify=#{bankAccountIdentify}")
|
|
||||||
public void updateUserBankIdentify(UserBankIdentify userBankIdentifys);
|
|
||||||
|
|
||||||
@Delete("delete from usagedate where userName=#{userName}")
|
|
||||||
public void deleteUserBankIdentify(String userName);
|
|
||||||
}
|
|
@ -0,0 +1,31 @@
|
|||||||
|
package com.example.demo.loanService.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.example.demo.Dao.userMapper;
|
||||||
|
import com.example.demo.bean.User;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
public class startController {
|
||||||
|
@Autowired
|
||||||
|
private userMapper userMapper;
|
||||||
|
private User user=new User();
|
||||||
|
|
||||||
|
@RequestMapping("")//浏览商品之后点击申请贷款的按钮之后跳到的界面
|
||||||
|
public String doPost(HttpServletResponse response, HttpServletRequest request){
|
||||||
|
int num=1;//从登陆那里得到登陆者的序号
|
||||||
|
user=userMapper.selectUserByuserNum(num);
|
||||||
|
if(user.getIsIdentify()=="1"){
|
||||||
|
return "";//验证手机号的界面二号
|
||||||
|
}if(user.getIsIdentify()=="0"){
|
||||||
|
return "";//认证的界面
|
||||||
|
}else{
|
||||||
|
return "";//页面出错的界面
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,37 @@
|
|||||||
|
package com.example.demo.productService.service;
|
||||||
|
|
||||||
|
import com.example.demo.Dao.productHistroyMapper;
|
||||||
|
import com.example.demo.Dao.productMapper;
|
||||||
|
import com.example.demo.bean.Product;
|
||||||
|
import com.example.demo.bean.ProductHistroy;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class deletePro {
|
||||||
|
private nowTime nowTime = new nowTime();
|
||||||
|
@Autowired
|
||||||
|
private productMapper productMapper;
|
||||||
|
@Autowired
|
||||||
|
private productHistroyMapper proHisMapper;
|
||||||
|
|
||||||
|
|
||||||
|
public int delete(long productNum){
|
||||||
|
ProductHistroy productHistroy = new ProductHistroy();
|
||||||
|
if(productMapper.selectProductByProductNum(productNum)==null)return -1;
|
||||||
|
Product product = productMapper.selectProductByProductNum(productNum);
|
||||||
|
if(product == null)return -1;
|
||||||
|
productHistroy.setProductNum(product.getProductNum());
|
||||||
|
productHistroy.setProductName(product.getProductName());
|
||||||
|
productHistroy.setBankNum(product.getBankNum());
|
||||||
|
productHistroy.setCategory(product.getCategory());
|
||||||
|
productHistroy.setIntrate(product.getIntrate());
|
||||||
|
productHistroy.setProductDescription(product.getProductDescription());
|
||||||
|
|
||||||
|
productMapper.deleteProduct(productNum);
|
||||||
|
//productHistroy.setManagerNum(); manager.setManagerNum();调用登陆里面的一个接口得到managerNum
|
||||||
|
productHistroy.setDeleteTime(nowTime.nowTime());
|
||||||
|
proHisMapper.addProductHistroy(productHistroy);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
package com.example.demo.productService.tools;
|
package com.example.demo.productService.service;
|
||||||
|
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
@ -1,17 +1,23 @@
|
|||||||
package com.example.demo.productService.tools;
|
package com.example.demo.productService.service;
|
||||||
|
|
||||||
import com.example.demo.Dao.productHistroyMapper;
|
import com.example.demo.Dao.productHistroyMapper;
|
||||||
import com.example.demo.Dao.productMapper;
|
import com.example.demo.Dao.productMapper;
|
||||||
import com.example.demo.bean.Product;
|
import com.example.demo.bean.Product;
|
||||||
import com.example.demo.bean.ProductHistroy;
|
import com.example.demo.bean.ProductHistroy;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
public class updatePro {
|
public class updatePro {
|
||||||
private com.example.demo.productService.tools.nowTime nowTime;
|
private nowTime nowTime=new nowTime();
|
||||||
|
@Autowired
|
||||||
private productMapper productMapper;
|
private productMapper productMapper;
|
||||||
|
@Autowired
|
||||||
private productHistroyMapper proHisMapper;
|
private productHistroyMapper proHisMapper;
|
||||||
private ProductHistroy productHistroy;
|
|
||||||
|
|
||||||
public int update(Product product1){
|
public int update(Product product1){
|
||||||
|
ProductHistroy productHistroy = new ProductHistroy();
|
||||||
|
if(productMapper.selectProductByProductNum(product1.getProductNum())==null)return -1;
|
||||||
productMapper.updateProduct(product1);
|
productMapper.updateProduct(product1);
|
||||||
productHistroy.setProductNum(product1.getProductNum());
|
productHistroy.setProductNum(product1.getProductNum());
|
||||||
productHistroy.setProductName(product1.getProductName());
|
productHistroy.setProductName(product1.getProductName());
|
@ -1,20 +0,0 @@
|
|||||||
package com.example.demo.productService.tools;
|
|
||||||
|
|
||||||
import com.example.demo.Dao.productHistroyMapper;
|
|
||||||
import com.example.demo.bean.ProductHistroy;
|
|
||||||
|
|
||||||
public class deletePro {
|
|
||||||
private com.example.demo.productService.tools.nowTime nowTime;
|
|
||||||
private com.example.demo.Dao.productMapper productMapper;
|
|
||||||
private productHistroyMapper proHisMapper;
|
|
||||||
private ProductHistroy productHistroy;
|
|
||||||
|
|
||||||
public int delete(int productNum){
|
|
||||||
productMapper.deleteProduct(productNum);
|
|
||||||
productHistroy.setProductNum(productNum);
|
|
||||||
//productHistroy.setManagerNum(); manager.setManagerNum();调用登陆里面的一个接口得到managerNum
|
|
||||||
productHistroy.setUpLoadTime(nowTime.nowTime());
|
|
||||||
proHisMapper.addProductHistroy(productHistroy);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
|
@ -0,0 +1,36 @@
|
|||||||
|
package com.example.demo.register.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.example.demo.Dao.userBankIdMapper;
|
||||||
|
import com.example.demo.bean.UserBankIdentify;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServlet;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
public class bankCardController extends HttpServlet {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
userBankIdMapper userBankIdMapper;
|
||||||
|
|
||||||
|
@RequestMapping("")//手机表单界面
|
||||||
|
public String doPost(HttpServletResponse response, HttpServletRequest request){
|
||||||
|
try{
|
||||||
|
long num=1;//获取得到userNum
|
||||||
|
UserBankIdentify userBankIdentify=new UserBankIdentify();
|
||||||
|
userBankIdentify.setBankAccount(request.getParameter("mobile"));
|
||||||
|
userBankIdentify.setTrueName(request.getParameter("realname"));
|
||||||
|
userBankIdentify.setIdNum(request.getParameter("idNum"));
|
||||||
|
userBankIdentify.setTelephoneNum(request.getParameter("phoneNum"));
|
||||||
|
userBankIdentify.setUserNum(num);
|
||||||
|
userBankIdMapper.addUserBankIdentify(userBankIdentify);
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return "";//返回首页
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,35 @@
|
|||||||
|
package com.example.demo.register.controller;
|
||||||
|
|
||||||
|
import com.example.demo.register.phone;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.PrintWriter;
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
public class phoRegController {
|
||||||
|
|
||||||
|
phone phone=new phone();
|
||||||
|
|
||||||
|
@RequestMapping("")//第一个手机验证界面
|
||||||
|
public String doPost(HttpServletRequest request, HttpServletResponse response){
|
||||||
|
PrintWriter writer=null;
|
||||||
|
try{
|
||||||
|
int num=Integer.parseInt(request.getParameter("phoneNum"));
|
||||||
|
response.setContentType("text/hmtl;charset=utf-8");
|
||||||
|
writer=response.getWriter();
|
||||||
|
if(phone.phoneRegister(num)==1){
|
||||||
|
return "";//跳转到bankCardManager界面
|
||||||
|
}else{
|
||||||
|
writer.write("验证失败");
|
||||||
|
return "";//跳转到第一个手机验证界面
|
||||||
|
}
|
||||||
|
}catch (IOException e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return "页面出错";
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,35 @@
|
|||||||
|
package com.example.demo.register.controller;
|
||||||
|
|
||||||
|
import com.example.demo.register.phone;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.PrintWriter;
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
public class phoRegController2 {
|
||||||
|
|
||||||
|
phone phone=new phone();
|
||||||
|
|
||||||
|
@RequestMapping("")//第二个手机验证界面
|
||||||
|
public String doPost(HttpServletRequest request, HttpServletResponse response){
|
||||||
|
PrintWriter writer=null;
|
||||||
|
try{
|
||||||
|
int num=Integer.parseInt(request.getParameter("phoneNum"));
|
||||||
|
response.setContentType("text/hmtl;charset=utf-8");
|
||||||
|
writer=response.getWriter();
|
||||||
|
if(phone.phoneRegister(num)==1){
|
||||||
|
return "";//跳转到Loan界面
|
||||||
|
}else{
|
||||||
|
writer.write("验证失败");
|
||||||
|
return "";//跳转到第二个手机验证界面
|
||||||
|
}
|
||||||
|
}catch (IOException e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return "页面出错";
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
package com.example.demo.register;
|
||||||
|
|
||||||
|
|
||||||
|
//有一个mob网站可以提供一些手机号验证
|
||||||
|
public class phone {
|
||||||
|
public phone(){};
|
||||||
|
|
||||||
|
public int phoneRegister(int num){
|
||||||
|
if(num==1){
|
||||||
|
return 1;
|
||||||
|
}else{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue