├── .settings ├── org.eclipse.wst.jsdt.ui.superType.name ├── org.eclipse.wst.jsdt.ui.superType.container ├── org.eclipse.core.resources.prefs ├── org.eclipse.wst.ws.service.policy.prefs ├── org.eclipse.ltk.core.refactoring.prefs ├── org.eclipse.jst.j2ee.ejb.annotations.xdoclet.prefs ├── org.eclipse.wst.common.project.facet.core.xml ├── org.eclipse.wst.common.project.facet.core.xml.bak ├── .jsdtscope ├── org.eclipse.wst.common.component ├── org.eclipse.jdt.core.prefs └── org.springframework.ide.eclipse.xml.namespaces.prefs ├── image ├── 1.png ├── 2.png ├── 3.png ├── 4.png ├── 5.png ├── 6.png ├── 7.png ├── Snipaste_2022-10-04_09-08-50.png └── Snipaste_2022-10-04_09-09-03.png ├── src └── com │ ├── javabean │ ├── AlipayConfig.java │ ├── QueryVo.java │ ├── leaseimg.java │ ├── mydailylife.java │ ├── adminlist.java │ ├── headportraitimg.java │ ├── registered.java │ ├── userlist.java │ ├── rentwithdrawn.java │ ├── rentcollection.java │ ├── checkoutapplication.java │ ├── fault.java │ └── leaseinformation.java │ ├── service │ ├── AdminListService.java │ ├── HeadPortraitImgService.java │ ├── LeaseimgService.java │ ├── MydailylifeService.java │ ├── RentwithdrawnService.java │ ├── impl │ │ ├── AdminListMapperImpl.java │ │ ├── LeaseimgMapperImpl.java │ │ ├── HeadPortraitImgMapperImpl.java │ │ ├── RentwithdrawnMapperImpl.java │ │ ├── MydailylifeServiceimpl.java │ │ ├── FaultMapperImpl.java │ │ ├── RentcollectionMapperImpl.java │ │ ├── LeaseinformationMapperImpl.java │ │ ├── UserlistMapperImpl.java │ │ └── CheckoutapplicationMapperImpl.java │ ├── FaultService.java │ ├── RentcollectionService.java │ ├── CheckoutapplicationService.java │ ├── UserlistService.java │ └── LeaseinformationService.java │ ├── Servlet │ ├── ServletContextListener.java │ └── impl │ │ └── MyServletContextListener.java │ ├── dao │ ├── headportraitimgMapper.java │ ├── leaseimgMapper.java │ ├── registeredMapper.java │ ├── mydailylifeMapper.java │ ├── adminlistMapper.java │ ├── rentwithdrawnMapper.java │ ├── faultMapper.java │ ├── rentcollectionMapper.java │ ├── checkoutapplicationMapper.java │ ├── userlistMapper.java │ └── leaseinformationMapper.java │ ├── currency │ ├── Koken.java │ ├── Warning.java │ ├── Msg.java │ └── DocumentConversion.java │ ├── test │ └── MbgTest.java │ ├── controller │ ├── LeaseinformationController.java │ ├── AdminListControllerTest.java │ ├── OfficialController.java │ ├── PayController.java │ ├── UserListController.java │ ├── PersonacenterController.java │ └── Adminfunctioncontroller.java │ └── code │ └── Code.java ├── .idea ├── compiler.xml ├── misc.xml ├── modules.xml ├── encodings.xml ├── libraries │ └── lib.xml ├── artifacts │ └── ssm_leaseOfHouses_Web_exploded.xml ├── $CACHE_FILE$ └── workspace.xml ├── .project ├── README.md ├── .classpath └── ssm_leaseOfHouses.iml /.settings/org.eclipse.wst.jsdt.ui.superType.name: -------------------------------------------------------------------------------- 1 | Window -------------------------------------------------------------------------------- /.settings/org.eclipse.wst.jsdt.ui.superType.container: -------------------------------------------------------------------------------- 1 | org.eclipse.wst.jsdt.launching.baseBrowserLibrary -------------------------------------------------------------------------------- /.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /image/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No324Housing-Rental-Management-System/HEAD/image/1.png -------------------------------------------------------------------------------- /image/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No324Housing-Rental-Management-System/HEAD/image/2.png -------------------------------------------------------------------------------- /image/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No324Housing-Rental-Management-System/HEAD/image/3.png -------------------------------------------------------------------------------- /image/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No324Housing-Rental-Management-System/HEAD/image/4.png -------------------------------------------------------------------------------- /image/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No324Housing-Rental-Management-System/HEAD/image/5.png -------------------------------------------------------------------------------- /image/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No324Housing-Rental-Management-System/HEAD/image/6.png -------------------------------------------------------------------------------- /image/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No324Housing-Rental-Management-System/HEAD/image/7.png -------------------------------------------------------------------------------- /.settings/org.eclipse.wst.ws.service.policy.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.wst.ws.service.policy.projectEnabled=false 3 | -------------------------------------------------------------------------------- /src/com/javabean/AlipayConfig.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No324Housing-Rental-Management-System/HEAD/src/com/javabean/AlipayConfig.java -------------------------------------------------------------------------------- /.settings/org.eclipse.ltk.core.refactoring.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false 3 | -------------------------------------------------------------------------------- /image/Snipaste_2022-10-04_09-08-50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No324Housing-Rental-Management-System/HEAD/image/Snipaste_2022-10-04_09-08-50.png -------------------------------------------------------------------------------- /image/Snipaste_2022-10-04_09-09-03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No324Housing-Rental-Management-System/HEAD/image/Snipaste_2022-10-04_09-09-03.png -------------------------------------------------------------------------------- /.settings/org.eclipse.jst.j2ee.ejb.annotations.xdoclet.prefs: -------------------------------------------------------------------------------- 1 | XDOCLETBUILDERACTIVE=true 2 | XDOCLETHOME= 3 | XDOCLETUSEGLOBAL=true 4 | XDOCLETVERSION=1.2.1 5 | eclipse.preferences.version=1 6 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | -------------------------------------------------------------------------------- /src/com/service/AdminListService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import com.javabean.adminlist; 4 | 5 | public interface AdminListService { 6 | 7 | public adminlist findAll(Integer adminid); 8 | 9 | public adminlist findAllAdminPwd(adminlist record); 10 | } 11 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/com/Servlet/ServletContextListener.java: -------------------------------------------------------------------------------- 1 | package com.Servlet; 2 | 3 | import javax.servlet.ServletContextEvent; 4 | 5 | public interface ServletContextListener { 6 | 7 | public void contextInitialized(ServletContextEvent arg0); 8 | 9 | public void contextDestroyed(ServletContextEvent arg0); 10 | } 11 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/com/dao/headportraitimgMapper.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import com.javabean.headportraitimg; 4 | 5 | public interface headportraitimgMapper { 6 | int insertuserimg(headportraitimg headportraitimg); 7 | int deletuserimg(String name); 8 | int updatauserimg(headportraitimg headportraitimg); 9 | 10 | headportraitimg selectheadportrait(String userCall); 11 | } 12 | -------------------------------------------------------------------------------- /src/com/service/HeadPortraitImgService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import com.javabean.headportraitimg; 4 | 5 | public interface HeadPortraitImgService { 6 | int insertuserimg(headportraitimg headportraitimg); 7 | 8 | int updatauserimg(headportraitimg headportraitimg); 9 | 10 | int deletuserimg(String name); 11 | 12 | headportraitimg selectheadportrait(String user); 13 | } 14 | -------------------------------------------------------------------------------- /src/com/dao/leaseimgMapper.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import com.javabean.leaseimg; 4 | import java.util.List; 5 | 6 | public interface leaseimgMapper { 7 | int deleteByPrimaryKey(Integer id); 8 | 9 | int insert(leaseimg record); 10 | 11 | leaseimg selectByPrimaryKey(Integer id); 12 | 13 | List selectAll(); 14 | 15 | int updateByPrimaryKey(leaseimg record); 16 | } -------------------------------------------------------------------------------- /src/com/service/LeaseimgService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import java.util.List; 4 | 5 | import com.javabean.leaseimg; 6 | 7 | public interface LeaseimgService { 8 | /* 9 | * 查看所有图片 10 | **/ 11 | public List selectAll(); 12 | /* 13 | *添加图片 14 | **/ 15 | public int insert(leaseimg record); 16 | /* 17 | *删除图片 18 | **/ 19 | public int deleteByPrimaryKey(Integer id); 20 | } 21 | -------------------------------------------------------------------------------- /src/com/dao/registeredMapper.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import com.javabean.registered; 4 | import java.util.List; 5 | 6 | public interface registeredMapper { 7 | int deleteByPrimaryKey(Integer userid); 8 | 9 | int insert(registered record); 10 | 11 | registered selectByPrimaryKey(Integer userid); 12 | 13 | List selectAll(); 14 | 15 | int updateByPrimaryKey(registered record); 16 | } -------------------------------------------------------------------------------- /.settings/org.eclipse.wst.common.project.facet.core.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/com/dao/mydailylifeMapper.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import com.javabean.mydailylife; 4 | import java.util.List; 5 | 6 | public interface mydailylifeMapper { 7 | int deleteByPrimaryKey(Integer mdlid); 8 | 9 | int insert(mydailylife record); 10 | 11 | mydailylife selectByPrimaryKey(Integer mdlid); 12 | 13 | List selectAll(); 14 | 15 | int updateByPrimaryKey(mydailylife record); 16 | } -------------------------------------------------------------------------------- /.settings/org.eclipse.wst.common.project.facet.core.xml.bak: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/com/service/MydailylifeService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import java.util.List; 4 | 5 | import com.javabean.mydailylife; 6 | 7 | public interface MydailylifeService { 8 | int deleteByPrimaryKey(Integer mdlid); 9 | 10 | int insert(mydailylife record); 11 | 12 | mydailylife selectByPrimaryKey(Integer mdlid); 13 | 14 | List selectAll(); 15 | 16 | int updateByPrimaryKey(mydailylife record); 17 | } 18 | -------------------------------------------------------------------------------- /src/com/dao/adminlistMapper.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import com.javabean.adminlist; 4 | import java.util.List; 5 | 6 | public interface adminlistMapper { 7 | int deleteByPrimaryKey(Integer adminid); 8 | 9 | int insert(adminlist record); 10 | 11 | adminlist selectByPrimaryKey(Integer adminid); 12 | 13 | adminlist queryAllAdminPwd(adminlist record); 14 | 15 | List selectAll(); 16 | 17 | int updateByPrimaryKey(adminlist record); 18 | } -------------------------------------------------------------------------------- /.idea/libraries/lib.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/com/currency/Koken.java: -------------------------------------------------------------------------------- 1 | package com.currency; 2 | /** 3 | * 令牌 4 | */ 5 | import javax.servlet.http.HttpServletRequest; 6 | import javax.servlet.http.HttpSession; 7 | 8 | public class Koken { 9 | 10 | public boolean kokenid(HttpServletRequest request,HttpSession session){ 11 | Object token1=session.getAttribute("token"); 12 | String token2=request.getParameter("token"); 13 | if(token1!=null && !"".equals(token1)) { 14 | if(token1.toString().equals(token2)) { 15 | return true; 16 | } 17 | } 18 | return false; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/com/Servlet/impl/MyServletContextListener.java: -------------------------------------------------------------------------------- 1 | package com.Servlet.impl; 2 | 3 | import javax.servlet.ServletContextEvent; 4 | 5 | import com.Servlet.ServletContextListener; 6 | 7 | public class MyServletContextListener implements ServletContextListener{ 8 | 9 | @Override 10 | public void contextInitialized(ServletContextEvent arg0) { 11 | System.out.println("===========开启=========="); 12 | } 13 | 14 | @Override 15 | public void contextDestroyed(ServletContextEvent arg0) { 16 | System.out.println("===========关闭=========="); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/com/service/RentwithdrawnService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import java.util.List; 4 | 5 | import com.currency.Warning; 6 | import com.javabean.rentwithdrawn; 7 | 8 | 9 | public interface RentwithdrawnService { 10 | 11 | /** 12 | * 查询筛选所有租赁信息数据 13 | */ 14 | public List queryAllStateName(String State1,String State2,String Name); 15 | 16 | /** 17 | * 删除退租记录 18 | */ 19 | public Warning deleteByPrimaryKey(Integer rwid); 20 | 21 | /** 22 | * 查询所有退租记录 23 | */ 24 | public List selectRwState(String state); 25 | } 26 | -------------------------------------------------------------------------------- /src/com/dao/rentwithdrawnMapper.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import com.javabean.rentwithdrawn; 4 | import java.util.List; 5 | 6 | public interface rentwithdrawnMapper { 7 | int deleteByPrimaryKey(Integer rwid); 8 | 9 | int insert(rentwithdrawn record); 10 | 11 | rentwithdrawn selectByPrimaryKey(Integer rwid); 12 | 13 | List selectAll(); 14 | 15 | List selectStateName(rentwithdrawn record); 16 | 17 | int updateByPrimaryKey(rentwithdrawn record); 18 | 19 | List selectRwState(String state); 20 | } -------------------------------------------------------------------------------- /.settings/.jsdtscope: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/artifacts/ssm_leaseOfHouses_Web_exploded.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | $PROJECT_DIR$/classes/artifacts/ssm_leaseOfHouses_Web_exploded 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.settings/org.eclipse.wst.common.component: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/com/javabean/QueryVo.java: -------------------------------------------------------------------------------- 1 | package com.javabean; 2 | 3 | public class QueryVo { 4 | private String zuname; 5 | private String fromdate; 6 | private String todate; 7 | 8 | 9 | public String getZuname() { 10 | return zuname; 11 | } 12 | public void setZuname(String zuname) { 13 | this.zuname = zuname; 14 | } 15 | public String getFromdate() { 16 | return fromdate; 17 | } 18 | public void setFromdate(String fromdate) { 19 | this.fromdate = fromdate; 20 | } 21 | public String getTodate() { 22 | return todate; 23 | } 24 | public void setTodate(String todate) { 25 | this.todate = todate; 26 | } 27 | 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/com/dao/faultMapper.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import com.javabean.QueryVo; 4 | import com.javabean.fault; 5 | import java.util.List; 6 | 7 | public interface faultMapper { 8 | int deleteByPrimaryKey(Integer fid); 9 | 10 | int insert(fault record); 11 | 12 | fault selectByPrimaryKey(Integer fid); 13 | 14 | List selectAll(); 15 | 16 | List selectRepairStateNameAll(fault record); 17 | 18 | int updateByPrimaryKey(fault record); 19 | 20 | 21 | /** 22 | * 管理员待处理报障查询 23 | * */ 24 | List AdminSelectStateAll(fault record); 25 | 26 | List repairselect(QueryVo vo); 27 | } -------------------------------------------------------------------------------- /src/com/currency/Warning.java: -------------------------------------------------------------------------------- 1 | package com.currency; 2 | 3 | public class Warning { 4 | private int WarningJudge;// 0绿色,1黄色,2红色 5 | private String WarningContent;// 存放内容 6 | 7 | public int getWarningJudge() { 8 | return WarningJudge; 9 | } 10 | 11 | public void setWarningJudge(int warningJudge) { 12 | WarningJudge = warningJudge; 13 | } 14 | 15 | public String getWarningContent() { 16 | return WarningContent; 17 | } 18 | 19 | public void setWarningContent(String warningContent) { 20 | WarningContent = warningContent; 21 | } 22 | 23 | public Warning(int warningJudge, String warningContent) { 24 | super(); 25 | WarningJudge = warningJudge; 26 | WarningContent = warningContent; 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/com/javabean/leaseimg.java: -------------------------------------------------------------------------------- 1 | package com.javabean; 2 | 3 | public class leaseimg { 4 | private Integer id; 5 | 6 | private String imgname; 7 | 8 | private String imgroute; 9 | 10 | public Integer getId() { 11 | return id; 12 | } 13 | 14 | public void setId(Integer id) { 15 | this.id = id; 16 | } 17 | 18 | public String getImgname() { 19 | return imgname; 20 | } 21 | 22 | public void setImgname(String imgname) { 23 | this.imgname = imgname == null ? null : imgname.trim(); 24 | } 25 | 26 | public String getImgroute() { 27 | return imgroute; 28 | } 29 | 30 | public void setImgroute(String imgroute) { 31 | this.imgroute = imgroute == null ? null : imgroute.trim(); 32 | } 33 | } -------------------------------------------------------------------------------- /src/com/javabean/mydailylife.java: -------------------------------------------------------------------------------- 1 | package com.javabean; 2 | 3 | public class mydailylife { 4 | private Integer mdlid; 5 | 6 | private String mdldate; 7 | 8 | private String mdlcontent; 9 | 10 | public Integer getMdlid() { 11 | return mdlid; 12 | } 13 | 14 | public void setMdlid(Integer mdlid) { 15 | this.mdlid = mdlid; 16 | } 17 | 18 | public String getMdldate() { 19 | return mdldate; 20 | } 21 | 22 | public void setMdldate(String mdldate) { 23 | this.mdldate = mdldate == null ? null : mdldate.trim(); 24 | } 25 | 26 | public String getMdlcontent() { 27 | return mdlcontent; 28 | } 29 | 30 | public void setMdlcontent(String mdlcontent) { 31 | this.mdlcontent = mdlcontent == null ? null : mdlcontent.trim(); 32 | } 33 | } -------------------------------------------------------------------------------- /src/com/javabean/adminlist.java: -------------------------------------------------------------------------------- 1 | package com.javabean; 2 | 3 | public class adminlist { 4 | private Integer adminid; 5 | 6 | private String adminname; 7 | 8 | private String adminpwd; 9 | 10 | public Integer getAdminid() { 11 | return adminid; 12 | } 13 | 14 | public void setAdminid(Integer adminid) { 15 | this.adminid = adminid; 16 | } 17 | 18 | public String getAdminname() { 19 | return adminname; 20 | } 21 | 22 | public void setAdminname(String adminname) { 23 | this.adminname = adminname == null ? null : adminname.trim(); 24 | } 25 | 26 | public String getAdminpwd() { 27 | return adminpwd; 28 | } 29 | 30 | public void setAdminpwd(String adminpwd) { 31 | this.adminpwd = adminpwd == null ? null : adminpwd.trim(); 32 | } 33 | } -------------------------------------------------------------------------------- /src/com/service/impl/AdminListMapperImpl.java: -------------------------------------------------------------------------------- 1 | package com.service.impl; 2 | /** 3 | * 管理员Serviceimpl 4 | */ 5 | import javax.annotation.Resource; 6 | 7 | import org.springframework.stereotype.Service; 8 | import org.springframework.transaction.annotation.Transactional; 9 | 10 | import com.dao.adminlistMapper; 11 | import com.javabean.adminlist; 12 | import com.service.AdminListService; 13 | @Service("adminListService") 14 | @Transactional 15 | public class AdminListMapperImpl implements AdminListService{ 16 | 17 | @Resource 18 | private adminlistMapper adminlistMapper; 19 | 20 | @Override 21 | public adminlist findAll(Integer adminid) { 22 | return adminlistMapper.selectByPrimaryKey(adminid); 23 | } 24 | 25 | @Override 26 | public adminlist findAllAdminPwd(adminlist record) { 27 | return adminlistMapper.queryAllAdminPwd(record); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 | org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate 4 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 5 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve 6 | org.eclipse.jdt.core.compiler.compliance=1.8 7 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate 8 | org.eclipse.jdt.core.compiler.debug.localVariable=generate 9 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate 10 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 11 | org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled 12 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 13 | org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning 14 | org.eclipse.jdt.core.compiler.release=enabled 15 | org.eclipse.jdt.core.compiler.source=1.8 16 | -------------------------------------------------------------------------------- /src/com/service/FaultService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import java.util.List; 4 | 5 | import com.currency.Warning; 6 | import com.javabean.QueryVo; 7 | import com.javabean.fault; 8 | 9 | public interface FaultService { 10 | 11 | /** 12 | * 状态查询报障内容 13 | */ 14 | public List queryAllState(String str,String name); 15 | 16 | /** 17 | * 删除报障记录 18 | */ 19 | public Warning deleteByPrimaryKey(Integer fid); 20 | 21 | /** 22 | * 添加报障内容 23 | */ 24 | public Warning insert(fault record); 25 | 26 | /** 27 | * 管理员查询待处理报障内容 28 | * */ 29 | public List AdminSelectStateAll(String state); 30 | 31 | /** 32 | * 管理员修改状态--查询所要修改的数据 33 | * */ 34 | public fault selectByPrimaryKey(Integer fid); 35 | 36 | /** 37 | * 管理员修改状态--更改状态 38 | * */ 39 | public int updateByPrimaryKey(fault record); 40 | 41 | /** 42 | * 搜索报障 43 | * */ 44 | public List repairselect(QueryVo vo); 45 | } 46 | -------------------------------------------------------------------------------- /src/com/javabean/headportraitimg.java: -------------------------------------------------------------------------------- 1 | package com.javabean; 2 | 3 | public class headportraitimg { 4 | private int headportraitimgid; 5 | private String headportraitimgusername; 6 | private String headportraitimgaddress; 7 | 8 | public int getHeadportraitimgid() { 9 | return headportraitimgid; 10 | } 11 | 12 | public void setHeadportraitimgid(int headportraitimgid) { 13 | this.headportraitimgid = headportraitimgid; 14 | } 15 | 16 | public String getHeadportraitimgusername() { 17 | return headportraitimgusername; 18 | } 19 | 20 | public void setHeadportraitimgusername(String headportraitimgusername) { 21 | this.headportraitimgusername = headportraitimgusername; 22 | } 23 | 24 | public String getHeadportraitimgaddress() { 25 | return headportraitimgaddress; 26 | } 27 | 28 | public void setHeadportraitimgaddress(String headportraitimgaddress) { 29 | this.headportraitimgaddress = headportraitimgaddress; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/com/dao/rentcollectionMapper.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | 4 | import com.javabean.QueryVo; 5 | import com.javabean.rentcollection; 6 | 7 | import java.util.Date; 8 | import java.util.List; 9 | 10 | import org.apache.ibatis.annotations.Param; 11 | 12 | public interface rentcollectionMapper { 13 | int deleteByPrimaryKey(Integer rcid); 14 | 15 | void insert(rentcollection record); 16 | 17 | rentcollection selectByPrimaryKey(Integer rcid); 18 | 19 | List selectAll(); 20 | 21 | List selectPaidStateNameAll(rentcollection rentcollection); 22 | 23 | int updateByPrimaryKey(rentcollection record); 24 | 25 | int updateUserName(rentcollection record); 26 | 27 | int updateState(@Param("rcid") Integer rchouseid,@Param("date") String date); 28 | 29 | List selectPaidStateAll(rentcollection record); 30 | 31 | List selectPaidAll(QueryVo vo); 32 | } -------------------------------------------------------------------------------- /src/com/service/impl/LeaseimgMapperImpl.java: -------------------------------------------------------------------------------- 1 | package com.service.impl; 2 | 3 | import java.util.List; 4 | 5 | import javax.annotation.Resource; 6 | 7 | import org.springframework.stereotype.Service; 8 | 9 | import com.dao.leaseimgMapper; 10 | import com.javabean.leaseimg; 11 | import com.service.LeaseimgService; 12 | @Service("leaseimgService") 13 | public class LeaseimgMapperImpl implements LeaseimgService { 14 | 15 | @Resource 16 | private leaseimgMapper leaseimgMapper; 17 | 18 | @Override 19 | public List selectAll() { 20 | // TODO Auto-generated method stub 21 | return leaseimgMapper.selectAll(); 22 | } 23 | 24 | @Override 25 | public int insert(leaseimg record) { 26 | // TODO Auto-generated method stub 27 | return leaseimgMapper.insert(record); 28 | } 29 | 30 | @Override 31 | public int deleteByPrimaryKey(Integer id) { 32 | // TODO Auto-generated method stub 33 | return leaseimgMapper.deleteByPrimaryKey(id); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/com/dao/checkoutapplicationMapper.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import com.javabean.checkoutapplication; 4 | 5 | import java.util.List; 6 | 7 | public interface checkoutapplicationMapper { 8 | int deleteByPrimaryKey(Integer coaid); 9 | 10 | int insert(checkoutapplication record); 11 | 12 | checkoutapplication selectByPrimaryKey(Integer coaid); 13 | 14 | List selectAll(); 15 | 16 | List selectStateAll(checkoutapplication record); 17 | 18 | checkoutapplication selectCallState(checkoutapplication record); 19 | 20 | int updateCallState (checkoutapplication record); 21 | 22 | int updateByPrimaryKey(checkoutapplication record); 23 | 24 | int updateState(checkoutapplication record); 25 | 26 | List selectCoaState(); 27 | 28 | boolean xgaiCoaState(checkoutapplication record); 29 | 30 | List selectCoaState1(); 31 | } -------------------------------------------------------------------------------- /src/com/service/RentcollectionService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import java.util.List; 4 | 5 | import com.currency.Warning; 6 | import com.javabean.QueryVo; 7 | import com.javabean.rentcollection; 8 | 9 | public interface RentcollectionService { 10 | 11 | /** 12 | * 查询筛选所有缴费信息数据 13 | */ 14 | public List queryPaidStateAll(String state,String name); 15 | 16 | /** 17 | * 对应id删除数据 18 | */ 19 | public Warning deleteByPrimaryKey(Integer rcid); 20 | 21 | /** 22 | * 添加数据 23 | * */ 24 | public void insert(rentcollection record); 25 | 26 | /** 27 | * 支付租金 28 | */ 29 | public Warning updateState(Integer rchouseid); 30 | 31 | /** 32 | *查询代缴租金 33 | * */ 34 | public List selectPaidStateAll(String rcstate); 35 | 36 | /** 37 | * 搜索查询 38 | * */ 39 | public List selectPaidAll(QueryVo vo); 40 | 41 | /** 42 | * 修改真实姓名 43 | */ 44 | public String updateUserName(String username,String rcusernametemp); 45 | } 46 | -------------------------------------------------------------------------------- /src/com/test/MbgTest.java: -------------------------------------------------------------------------------- 1 | package com.test; 2 | 3 | import java.io.File; 4 | import java.util.ArrayList; 5 | import java.util.List; 6 | 7 | import org.mybatis.generator.api.MyBatisGenerator; 8 | import org.mybatis.generator.config.Configuration; 9 | import org.mybatis.generator.config.xml.ConfigurationParser; 10 | import org.mybatis.generator.internal.DefaultShellCallback; 11 | 12 | 13 | 14 | public class MbgTest { 15 | public static void main(String[] args) throws Exception, Exception { 16 | List warnings = new ArrayList(); 17 | boolean overwrite = true; 18 | File configFile = new File("mgb.xml"); 19 | ConfigurationParser cp = new ConfigurationParser(warnings); 20 | Configuration config = cp.parseConfiguration(configFile); 21 | DefaultShellCallback callback = new DefaultShellCallback(overwrite); 22 | MyBatisGenerator myBatisGenerator = new MyBatisGenerator(config, callback, warnings); 23 | myBatisGenerator.generate(null); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | ssm_leaseOfHouses 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.wst.common.project.facet.core.builder 15 | 16 | 17 | 18 | 19 | org.eclipse.wst.validation.validationbuilder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.jem.workbench.JavaEMFNature 26 | org.eclipse.wst.common.modulecore.ModuleCoreNature 27 | org.eclipse.wst.common.project.facet.core.nature 28 | org.eclipse.jdt.core.javanature 29 | org.eclipse.wst.jsdt.core.jsNature 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/com/dao/userlistMapper.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import com.javabean.userlist; 4 | import java.util.List; 5 | 6 | public interface userlistMapper { 7 | int deleteByPrimaryKey(Integer userid); 8 | 9 | int insert(userlist record); 10 | 11 | userlist selectByPrimaryKey(Integer userid); 12 | 13 | userlist selectUserPwd(userlist record); 14 | 15 | userlist selectUserId(Integer userid); 16 | 17 | userlist selectUserCall(String usercall); 18 | 19 | userlist selectUserName(String username); 20 | 21 | List selectUserNameWith(String username); 22 | 23 | userlist selectHouseCallWith(String housecall); 24 | 25 | List selectAll(); 26 | 27 | int updateByPrimaryKey(userlist record); 28 | 29 | int updateByPrimaryCall(userlist record); 30 | 31 | int updateJointTableName(userlist record); 32 | 33 | int updateJointTabledelete(String username); 34 | 35 | userlist selectUserPhone(String userphone); 36 | 37 | List rentSelectAll(); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/com/javabean/registered.java: -------------------------------------------------------------------------------- 1 | package com.javabean; 2 | 3 | public class registered { 4 | private Integer userid; 5 | 6 | private String username; 7 | 8 | private String userpwd; 9 | 10 | private String userphone; 11 | 12 | public Integer getUserid() { 13 | return userid; 14 | } 15 | 16 | public void setUserid(Integer userid) { 17 | this.userid = userid; 18 | } 19 | 20 | public String getUsername() { 21 | return username; 22 | } 23 | 24 | public void setUsername(String username) { 25 | this.username = username == null ? null : username.trim(); 26 | } 27 | 28 | public String getUserpwd() { 29 | return userpwd; 30 | } 31 | 32 | public void setUserpwd(String userpwd) { 33 | this.userpwd = userpwd == null ? null : userpwd.trim(); 34 | } 35 | 36 | public String getUserphone() { 37 | return userphone; 38 | } 39 | 40 | public void setUserphone(String userphone) { 41 | this.userphone = userphone == null ? null : userphone.trim(); 42 | } 43 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 基于SSM的房屋租赁系统 2 | = 3 | ### 完整代码获取地址:从戎源码网 ([https://armycodes.com/](https://armycodes.com/)) 4 | ### 作者微信:19941326836 QQ:952045282 5 | ### 承接计算机毕业设计、Java毕业设计、Python毕业设计、深度学习、机器学习 6 | ### 选题+开题报告+任务书+程序定制+安装调试+论文+答辩ppt 一条龙服务 7 | ### 所有选题地址https://github.com/nature924/allProject 8 | 9 | 一、项目介绍 10 | --- 11 | 基于SSM框架的房屋租赁系统,系统分为租客和管理员两个角色,主要功能如下 12 | 13 | ### 14 | 租客: 15 | 房源浏览、预约看房、关注房源、租赁信息、租赁申请信息、缴纳租金、报障模块 16 | ### 17 | 管理员: 18 | 房源信息:房源列表、添加房源 19 | 租赁及合同信息:在租列表、已退租列表 20 | 申请列表:看房申请、退租申请 21 | 报障模块:待处理报障、已处理报障 22 | 租金信息:我要收租、租客代缴租金、租客已缴租金 23 | 我的日程:查看日程、添加日程 24 | 25 | 26 | 二、项目技术 27 | --- 28 | - 编程语言:Java 29 | - 数据库:MySQL 30 | - 项目管理工具:Maven 31 | - 前端技术:JSP、HTML、Jquery、Layui、ECharts 32 | - 后端技术:Spring、SpringMVC、MyBatis 33 | 34 | 三、运行环境 35 | --- 36 | - 操作系统:Windows、macOS都可以 37 | - JDK版本:JDK1.8以上都可以 38 | - 开发工具:IDEA、Ecplise、Myecplise都可以 39 | - 数据库: MySQL5.7以上都可以 40 | - Tomcat:任意版本都可以 41 | - Maven:任意版本都可以 42 | 43 | 四、运行截图 44 | --- 45 | 46 | 47 | ### 程序截图: 48 | ![image/1.png](image/1.png) 49 | ![image/1.png](image/2.png) 50 | ![image/1.png](image/3.png) 51 | ![image/1.png](image/4.png) 52 | ![image/1.png](image/5.png) 53 | ![image/1.png](image/6.png) 54 | ![image/1.png](image/7.png) 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /src/com/currency/Msg.java: -------------------------------------------------------------------------------- 1 | package com.currency; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | public class Msg { 7 | // 状态吗 100成功 200失败 8 | private int code; 9 | // 提示信息 10 | private String msg; 11 | 12 | // 用户要返回给浏览器数据 13 | private Map extend = new HashMap(); 14 | 15 | public static Msg success() { 16 | Msg result=new Msg(); 17 | result.setCode(100); 18 | result.setMsg("处理成功"); 19 | return result; 20 | } 21 | 22 | public static Msg fail() { 23 | Msg result=new Msg(); 24 | result.setCode(200); 25 | result.setMsg("处理失败"); 26 | return result; 27 | } 28 | 29 | public Msg add(String key,Object value) { 30 | this.getExtend().put(key, value); 31 | return this; 32 | } 33 | 34 | public int getCode() { 35 | return code; 36 | } 37 | 38 | public void setCode(int code) { 39 | this.code = code; 40 | } 41 | 42 | public String getMsg() { 43 | return msg; 44 | } 45 | 46 | public void setMsg(String msg) { 47 | this.msg = msg; 48 | } 49 | 50 | public Map getExtend() { 51 | return extend; 52 | } 53 | 54 | public void setExtend(Map extend) { 55 | this.extend = extend; 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/com/service/impl/HeadPortraitImgMapperImpl.java: -------------------------------------------------------------------------------- 1 | package com.service.impl; 2 | import javax.annotation.Resource; 3 | 4 | /** 5 | * 上传头像Serviceimpl 6 | */ 7 | import org.springframework.stereotype.Service; 8 | import org.springframework.transaction.annotation.Transactional; 9 | 10 | import com.dao.headportraitimgMapper; 11 | import com.javabean.headportraitimg; 12 | import com.service.HeadPortraitImgService; 13 | @Service("headPortraitImgService") 14 | @Transactional 15 | public class HeadPortraitImgMapperImpl implements HeadPortraitImgService{ 16 | 17 | @Resource 18 | private headportraitimgMapper headportraitimgMapper; 19 | 20 | @Override 21 | public int updatauserimg(headportraitimg headportraitimg) { 22 | return headportraitimgMapper.updatauserimg(headportraitimg); 23 | } 24 | 25 | @Override 26 | public headportraitimg selectheadportrait(String user) { 27 | return headportraitimgMapper.selectheadportrait(user); 28 | } 29 | 30 | @Override 31 | public int insertuserimg(headportraitimg headportraitimg) { 32 | 33 | return headportraitimgMapper.insertuserimg(headportraitimg); 34 | } 35 | 36 | @Override 37 | public int deletuserimg(String name) { 38 | return headportraitimgMapper.deletuserimg(name); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/com/dao/leaseinformationMapper.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import com.javabean.leaseinformation; 4 | import java.util.List; 5 | 6 | public interface leaseinformationMapper { 7 | int deleteByPrimaryKey(Integer houseid); 8 | 9 | void insert(leaseinformation record); 10 | 11 | leaseinformation selectByPrimaryKey(Integer houseid); 12 | List selectByPrimaryKey1(Integer houseid); 13 | 14 | List selectAll(); 15 | 16 | List selectNameAll(String username); 17 | 18 | List selectHouseCall(String housecall); 19 | 20 | int updateByPrimaryKey(leaseinformation record); 21 | 22 | int updateCancelForeignKey(String housecall); 23 | 24 | List selectAllWith(); 25 | 26 | List selectByPrimaryKeyWith(Integer houseid); 27 | 28 | List selecthousteaseWith(String state); 29 | 30 | List selectRecommend(); 31 | 32 | boolean updacontract(Integer id); 33 | 34 | List selectState(String state); 35 | 36 | List selectHouseQuery(String housequery); 37 | 38 | List selectAllLeasable(); 39 | } -------------------------------------------------------------------------------- /src/com/service/CheckoutapplicationService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import java.util.List; 4 | 5 | import com.currency.Warning; 6 | import com.javabean.checkoutapplication; 7 | import com.javabean.userlist; 8 | 9 | public interface CheckoutapplicationService { 10 | 11 | /** 12 | * 查询所有退房申请中 13 | */ 14 | public List findAll(); 15 | 16 | /** 17 | * 查询退房历史记录 18 | */ 19 | public List selectStateAll(String State1,String State2,String State3,String Name); 20 | 21 | /** 22 | * 申请退房 23 | */ 24 | public Warning insert(userlist userlist); 25 | 26 | /** 27 | * 终止退房申请 28 | */ 29 | public Warning updateCallState (String coastate,String coahouseid); 30 | 31 | /** 32 | * 同意拒绝退房申请 33 | */ 34 | public String updateState (String coastate,Integer coaid); 35 | 36 | /** 37 | * 删除申请记录 38 | */ 39 | public Warning deleteByPrimaryKey (Integer coaid); 40 | 41 | /** 42 | * 添加申请 43 | */ 44 | public String insertApply (checkoutapplication checkoutapplication); 45 | 46 | /** 47 | * 查询申请中的记录 48 | */ 49 | public List selectCoaState(); 50 | 51 | /** 52 | * 修改状态 53 | */ 54 | public boolean xgaiCoaState(String coastate,Integer coaid); 55 | 56 | /** 57 | * 查询不是申请中的记录 58 | */ 59 | public List selectCoaState1(); 60 | 61 | } 62 | -------------------------------------------------------------------------------- /src/com/controller/LeaseinformationController.java: -------------------------------------------------------------------------------- 1 | package com.controller; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Controller; 7 | import org.springframework.web.bind.annotation.PathVariable; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RequestParam; 10 | import org.springframework.web.servlet.ModelAndView; 11 | 12 | import com.fasterxml.jackson.annotation.JsonTypeInfo.Id; 13 | import com.javabean.leaseinformation; 14 | import com.service.LeaseinformationService; 15 | 16 | /** 17 | * 房屋信息控制器 18 | * @author Administrator 19 | * 20 | */ 21 | 22 | @Controller 23 | @RequestMapping("/leaseinformationmvc") 24 | public class LeaseinformationController { 25 | @Autowired 26 | LeaseinformationService leaseinformationService; 27 | 28 | @RequestMapping("/details") 29 | public ModelAndView listCategory(@RequestParam int id){ 30 | ModelAndView mav = new ModelAndView("details"); 31 | List cs= leaseinformationService.allANDimg1(id); 32 | for (leaseinformation leaseinformation : cs) { 33 | System.out.println(leaseinformation.getLeaseimg().getImgroute()); 34 | } 35 | // 放入转发参数 36 | mav.addObject("cs", cs); 37 | return mav; 38 | } 39 | 40 | } -------------------------------------------------------------------------------- /src/com/service/impl/RentwithdrawnMapperImpl.java: -------------------------------------------------------------------------------- 1 | package com.service.impl; 2 | /** 3 | * 已退租记录Serviceimpl 4 | */ 5 | import java.util.List; 6 | 7 | import javax.annotation.Resource; 8 | 9 | import org.springframework.stereotype.Service; 10 | import org.springframework.transaction.annotation.Transactional; 11 | 12 | import com.currency.Warning; 13 | import com.dao.rentwithdrawnMapper; 14 | import com.javabean.leaseinformation; 15 | import com.javabean.rentwithdrawn; 16 | import com.service.RentwithdrawnService; 17 | @Service("rentwithdrawnService") 18 | @Transactional 19 | public class RentwithdrawnMapperImpl implements RentwithdrawnService { 20 | 21 | @Resource 22 | private rentwithdrawnMapper rentwithdrawnMapper; 23 | 24 | @Override 25 | public List queryAllStateName(String state1,String state2,String Name) { 26 | rentwithdrawn rentwithdrawn=new rentwithdrawn(); 27 | rentwithdrawn.setState1(state1); 28 | rentwithdrawn.setState2(state2); 29 | rentwithdrawn.setRwusername(Name); 30 | return rentwithdrawnMapper.selectStateName(rentwithdrawn); 31 | } 32 | 33 | @Override 34 | public Warning deleteByPrimaryKey(Integer rwid) { 35 | return rentwithdrawnMapper.deleteByPrimaryKey(rwid)>0?new Warning(0, "删除成功!"):new Warning(2, "删除失败!"); 36 | } 37 | 38 | @Override 39 | public List selectRwState(String state) { 40 | return rentwithdrawnMapper.selectRwState(state); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/com/code/Code.java: -------------------------------------------------------------------------------- 1 | package com.code; 2 | 3 | import com.zhenzi.sms.ZhenziSmsClient; 4 | import java.util.HashMap; 5 | import java.util.Map; 6 | import java.util.Random; 7 | 8 | import javax.servlet.http.HttpServletRequest; 9 | import javax.servlet.http.HttpSession; 10 | 11 | public class Code { 12 | public static String getNum(String phone) throws Exception{ 13 | 14 | ZhenziSmsClient client = new ZhenziSmsClient("https://sms_developer.zhenzikj.com", "107731", "5a1248e4-489f-45ce-854b-4a9c38e6c5d3"); 15 | 16 | Map params = new HashMap(); 17 | params.put("number", phone); 18 | params.put("templateId", "3082"); 19 | String[] templateParams = new String[2]; 20 | templateParams[0] = getVerifyCode(); 21 | templateParams[1] = "5分钟"; 22 | params.put("templateParams", templateParams); 23 | String result = client.send(params); 24 | return templateParams[0]; 25 | } 26 | //产生随机数 27 | public static String getVerifyCode() { 28 | String ch = "1234567890"; 29 | String result = ""; 30 | Random random = new Random(); 31 | for (int i = 0; i < 4; i++) { 32 | int index = random.nextInt(ch.length()); 33 | char c = ch.charAt(index); 34 | result += c; 35 | } 36 | return result; 37 | } 38 | public static void main(String[] args) { 39 | try { 40 | Code.getNum("18775756179"); 41 | } catch (Exception e) { 42 | // TODO Auto-generated catch block 43 | e.printStackTrace(); 44 | } 45 | } 46 | } -------------------------------------------------------------------------------- /src/com/service/impl/MydailylifeServiceimpl.java: -------------------------------------------------------------------------------- 1 | package com.service.impl; 2 | 3 | import java.util.List; 4 | 5 | import javax.annotation.Resource; 6 | 7 | import org.springframework.stereotype.Service; 8 | import org.springframework.transaction.annotation.Transactional; 9 | 10 | import com.dao.mydailylifeMapper; 11 | import com.javabean.mydailylife; 12 | import com.service.MydailylifeService; 13 | 14 | @Service("mydailylifeService") 15 | @Transactional 16 | public class MydailylifeServiceimpl implements MydailylifeService{ 17 | 18 | @Resource 19 | private mydailylifeMapper mydailylifeMapper; 20 | 21 | /** 22 | * 删除日程 23 | * */ 24 | @Override 25 | public int deleteByPrimaryKey(Integer mdlid) { 26 | // TODO Auto-generated method stub 27 | return mydailylifeMapper.deleteByPrimaryKey(mdlid); 28 | } 29 | /** 30 | * 添加日程 31 | * */ 32 | @Override 33 | public int insert(mydailylife record) { 34 | // TODO Auto-generated method stub 35 | return mydailylifeMapper.insert(record); 36 | } 37 | 38 | @Override 39 | public mydailylife selectByPrimaryKey(Integer mdlid) { 40 | // TODO Auto-generated method stub 41 | return mydailylifeMapper.selectByPrimaryKey(mdlid); 42 | } 43 | /** 44 | * 查询日程 45 | * */ 46 | @Override 47 | public List selectAll() { 48 | // TODO Auto-generated method stub 49 | return mydailylifeMapper.selectAll(); 50 | } 51 | /** 52 | * 修改日程 53 | * */ 54 | @Override 55 | public int updateByPrimaryKey(mydailylife record) { 56 | // TODO Auto-generated method stub 57 | return mydailylifeMapper.updateByPrimaryKey(record); 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /src/com/service/UserlistService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | import java.util.List; 3 | 4 | import com.currency.Warning; 5 | import com.javabean.userlist; 6 | 7 | public interface UserlistService { 8 | 9 | /** 10 | * 用户登录 11 | */ 12 | public userlist queryAllUserPwd(userlist record); 13 | 14 | /** 15 | * 查找用户称呼 16 | */ 17 | public userlist selectUserCall(String usercall); 18 | /** 19 | * 查找用户真实姓名 20 | */ 21 | public userlist selectUserName(String username); 22 | /** 23 | * 外键查询用户的租房信息 24 | */ 25 | public List selectUserNameWith(String username); 26 | 27 | /** 28 | * 外键查询房屋id 29 | */ 30 | public userlist selectUserCallWith(String housecall); 31 | 32 | /** 33 | * 查找用户手机 34 | */ 35 | public userlist selectUserPhone(String userphone); 36 | 37 | /** 38 | * 添加用户 39 | * */ 40 | public int insert(userlist record); 41 | 42 | /** 43 | * 修改密码 44 | * */ 45 | public int updatepwd(userlist record); 46 | 47 | /** 48 | * 修改个人信息 49 | */ 50 | public Warning updateByPrimaryCall(userlist record); 51 | 52 | /** 53 | * 查找所有用户 54 | */ 55 | public List selectAll(); 56 | 57 | /** 58 | * 删除用户 59 | * */ 60 | public int deleteByPrimaryKey(Integer id); 61 | 62 | /* 63 | * id查找用户 64 | * */ 65 | public userlist selectUserId(Integer userid); 66 | 67 | /** 68 | * 我要收租--查询 69 | * */ 70 | public List rentSelectAll(); 71 | 72 | /** 73 | * 修改联表数据 74 | */ 75 | public Warning updateJointTableName(userlist record); 76 | 77 | /** 78 | * 取消联表间的关系 79 | */ 80 | public String updateJointTabledelete(String username); 81 | } 82 | -------------------------------------------------------------------------------- /src/com/service/LeaseinformationService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import java.util.List; 4 | 5 | import com.javabean.leaseinformation; 6 | 7 | public interface LeaseinformationService { 8 | 9 | /** 10 | * 添加房屋 11 | */ 12 | public void addHouse(leaseinformation record); 13 | 14 | /** 15 | * 查询所有房屋数据 16 | */ 17 | public List queryAll(); 18 | 19 | /** 20 | * 查询对应姓名的房主 21 | */ 22 | public List queryNameAll(String name); 23 | 24 | /** 25 | * 查询对应房源id的房源 26 | */ 27 | List selectHouseCall(String housecall); 28 | 29 | /** 30 | * 查询对应的id信息 31 | */ 32 | public List queryID(Integer id); 33 | 34 | /** 35 | * 查询全部的链表 36 | */ 37 | public List allANDimg(); 38 | 39 | /** 40 | * 根据id查询全部的链表 41 | */ 42 | public List allANDimg1(Integer id); 43 | 44 | public List selecthousteaseWith(String steate); 45 | 46 | public boolean updacontract(Integer id); 47 | 48 | /** 49 | * 修改对应id的房源信息 50 | * */ 51 | public int updateByPrimaryKey(leaseinformation record); 52 | 53 | /** 54 | *删除对应id的房源信息 55 | * */ 56 | public int deleteByPrimaryKey(Integer id); 57 | 58 | /* 59 | * 推荐状态查询 60 | * */ 61 | public List selectRecommend(); 62 | 63 | /** 64 | * 官网查看可租聘的房屋 65 | */ 66 | public List selectState(String state); 67 | 68 | /** 69 | * 同意退租后删除外键 70 | */ 71 | public String updateCancelForeignKey(String housecall); 72 | 73 | /** 74 | * 模糊搜索房屋 75 | */ 76 | public List selectHouseQuery(String housequery); 77 | 78 | /** 79 | * 可租凭设推荐列表 80 | */ 81 | public List selectAllLeasable(); 82 | } 83 | -------------------------------------------------------------------------------- /src/com/controller/AdminListControllerTest.java: -------------------------------------------------------------------------------- 1 | package com.controller; 2 | 3 | import java.io.IOException; 4 | import java.io.UnsupportedEncodingException; 5 | 6 | import javax.annotation.Resource; 7 | import javax.servlet.http.HttpServletRequest; 8 | import javax.servlet.http.HttpServletResponse; 9 | 10 | import org.springframework.stereotype.Controller; 11 | import org.springframework.web.bind.annotation.RequestMapping; 12 | import org.springframework.web.bind.annotation.RequestParam; 13 | 14 | import com.javabean.adminlist; 15 | import com.javabean.leaseinformation; 16 | import com.service.AdminListService; 17 | import com.service.LeaseinformationService; 18 | 19 | @Controller 20 | @RequestMapping("/adminmvc") 21 | public class AdminListControllerTest { 22 | 23 | @Resource 24 | private AdminListService adminListService; 25 | 26 | @Resource 27 | private LeaseinformationService leaseinformationService; 28 | 29 | @RequestMapping("/official") 30 | public String official() { 31 | return "official"; 32 | } 33 | 34 | @RequestMapping("/test") 35 | public void test() { 36 | adminlist adminlist=adminListService.findAll(1); 37 | System.out.println(adminlist.getAdminname()); 38 | System.out.println(adminlist.getAdminpwd()); 39 | } 40 | 41 | /** 42 | * 批量添加楼房 43 | */ 44 | @RequestMapping("/add") 45 | public void add() { 46 | leaseinformation leaseinformation=new leaseinformation(); 47 | for(int i=2;i<100;i++) { 48 | leaseinformation.setHouseaddress("南宁市江南区银象路"+i+"号"); 49 | leaseinformation.setHousetype("楼房"); 50 | leaseinformation.setHousesize(70.2); 51 | leaseinformation.setHousemoney("3500"); 52 | leaseinformation.setHousestate("可出租"); 53 | 54 | leaseinformationService.addHouse(leaseinformation); 55 | } 56 | System.out.println("添加成功"); 57 | } 58 | 59 | /** 60 | * 个人信息切换页面测试 61 | * @throws IOException 62 | */ 63 | @RequestMapping("/temp") 64 | public void temp(String txt,HttpServletResponse response) throws IOException{ 65 | response.setCharacterEncoding("UTF-8"); 66 | if(txt.equals("租赁信息")) { 67 | response.getWriter().print("/jsp/personalInformation/temp.jsp"); 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/com/javabean/userlist.java: -------------------------------------------------------------------------------- 1 | package com.javabean; 2 | 3 | public class userlist { 4 | private Integer id; 5 | 6 | private String userid; 7 | 8 | private String username; 9 | 10 | private String usercall; 11 | 12 | private String userpwd; 13 | 14 | private String useremail; 15 | 16 | private String userphone; 17 | 18 | //修改联表暂时保存的查询字符串 19 | private String usernametemp; 20 | 21 | // 关联房屋 22 | private leaseinformation leaseinformation; 23 | 24 | public String getUsernametemp() { 25 | return usernametemp; 26 | } 27 | 28 | public void setUsernametemp(String usernametemp) { 29 | this.usernametemp = usernametemp; 30 | } 31 | 32 | public leaseinformation getLeaseinformation() { 33 | return leaseinformation; 34 | } 35 | 36 | public void setLeaseinformation(leaseinformation leaseinformation) { 37 | this.leaseinformation = leaseinformation; 38 | } 39 | 40 | public Integer getId() { 41 | return id; 42 | } 43 | 44 | public void setId(Integer id) { 45 | this.id = id; 46 | } 47 | 48 | public String getUserid() { 49 | return userid; 50 | } 51 | 52 | public void setUserid(String userid) { 53 | this.userid = userid; 54 | } 55 | 56 | public String getUsername() { 57 | return username; 58 | } 59 | 60 | public void setUsername(String username) { 61 | this.username = username == null ? null : username.trim(); 62 | } 63 | 64 | public String getUsercall() { 65 | return usercall; 66 | } 67 | 68 | public void setUsercall(String usercall) { 69 | this.usercall = usercall == null ? null : usercall.trim(); 70 | } 71 | 72 | public String getUserpwd() { 73 | return userpwd; 74 | } 75 | 76 | public void setUserpwd(String userpwd) { 77 | this.userpwd = userpwd == null ? null : userpwd.trim(); 78 | } 79 | 80 | public String getUseremail() { 81 | return useremail; 82 | } 83 | 84 | public void setUseremail(String useremail) { 85 | this.useremail = useremail == null ? null : useremail.trim(); 86 | } 87 | 88 | public String getUserphone() { 89 | return userphone; 90 | } 91 | 92 | public void setUserphone(String userphone) { 93 | this.userphone = userphone == null ? null : userphone.trim(); 94 | } 95 | } -------------------------------------------------------------------------------- /src/com/service/impl/FaultMapperImpl.java: -------------------------------------------------------------------------------- 1 | package com.service.impl; 2 | /** 3 | * 报障Serviceimpl 4 | */ 5 | import java.text.SimpleDateFormat; 6 | import java.util.List; 7 | 8 | import javax.annotation.Resource; 9 | 10 | import org.springframework.stereotype.Service; 11 | import org.springframework.transaction.annotation.Transactional; 12 | 13 | import com.currency.Warning; 14 | import com.dao.faultMapper; 15 | import com.javabean.QueryVo; 16 | import com.javabean.fault; 17 | import com.service.FaultService; 18 | @Service("faultService") 19 | @Transactional 20 | public class FaultMapperImpl implements FaultService { 21 | 22 | @Resource 23 | private faultMapper faultMapper; 24 | 25 | @Override 26 | public List queryAllState(String str,String name) { 27 | fault fault=new fault(); 28 | fault.setFstate(str); 29 | fault.setFusername(name); 30 | List templist=faultMapper.selectRepairStateNameAll(fault); 31 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); 32 | for(fault temp:templist) { 33 | String date = sdf.format(temp.getFdate()); 34 | temp.setFdatetemp(date); 35 | } 36 | return templist; 37 | } 38 | 39 | @Override 40 | public Warning deleteByPrimaryKey(Integer fid) { 41 | return faultMapper.deleteByPrimaryKey(fid)>0?new Warning(0, "删除成功!"):new Warning(2, "删除失败!"); 42 | } 43 | 44 | @Override 45 | public Warning insert(fault record) { 46 | return faultMapper.insert(record)>0?new Warning(0, "报障成功!"):new Warning(2, "报障失败"); 47 | } 48 | 49 | @Override 50 | public List AdminSelectStateAll(String state) { 51 | fault fault = new fault(); 52 | fault.setFstate(state); 53 | List faults = faultMapper.AdminSelectStateAll(fault); 54 | for(fault temp:faults) { 55 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); 56 | String date = sdf.format(temp.getFdate()); 57 | temp.setFdatetemp(date); 58 | } 59 | return faults; 60 | } 61 | 62 | @Override 63 | public fault selectByPrimaryKey(Integer fid) { 64 | return faultMapper.selectByPrimaryKey(fid); 65 | } 66 | 67 | @Override 68 | public int updateByPrimaryKey(fault record) { 69 | 70 | return faultMapper.updateByPrimaryKey(record); 71 | } 72 | 73 | @Override 74 | public List repairselect(QueryVo vo) { 75 | List list= faultMapper.repairselect(vo); 76 | return list; 77 | } 78 | 79 | } 80 | -------------------------------------------------------------------------------- /src/com/controller/OfficialController.java: -------------------------------------------------------------------------------- 1 | package com.controller; 2 | 3 | import java.util.List; 4 | import javax.annotation.Resource; 5 | 6 | import org.springframework.stereotype.Controller; 7 | import org.springframework.ui.Model; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RequestParam; 10 | import org.springframework.web.bind.annotation.ResponseBody; 11 | import org.springframework.web.servlet.ModelAndView; 12 | 13 | import com.currency.Msg; 14 | import com.github.pagehelper.PageHelper; 15 | import com.github.pagehelper.PageInfo; 16 | import com.javabean.leaseinformation; 17 | import com.service.LeaseinformationService; 18 | 19 | /** 20 | * 官网控制器 21 | * @author Administrator 22 | * 23 | */ 24 | @Controller 25 | @RequestMapping("/officialmvc") 26 | public class OfficialController { 27 | 28 | @Resource 29 | private LeaseinformationService leaseinformationService; 30 | 31 | /** 32 | * 分页查询 33 | */ 34 | @RequestMapping("/listByPage") 35 | @ResponseBody 36 | public Msg listByPage(@RequestParam(value = "pn")Integer pn) { 37 | //设置分页传输 38 | PageHelper.startPage(pn,8); 39 | //查询所有可租凭数据 40 | List list1=leaseinformationService.selectState("可租凭"); 41 | //使用PageInFo封装查询结果 42 | PageInfo pageInfo=new PageInfo(list1,5); 43 | return Msg.success().add("pageInfo",pageInfo); 44 | } 45 | 46 | /** 47 | * 推荐分页 48 | */ 49 | @RequestMapping("/recommend") 50 | @ResponseBody 51 | public Msg recommend(@RequestParam(value = "pn",defaultValue="1") Integer pn, 52 | @RequestParam(required=false,defaultValue="6") Integer pageSize) { 53 | PageHelper.startPage(pn,4); 54 | //查询所有数据 55 | List recommendlist1=leaseinformationService.selectRecommend(); 56 | PageInfo pages=new PageInfo(recommendlist1, 3); 57 | return Msg.success().add("pages",pages); 58 | 59 | } 60 | 61 | /** 62 | * 搜索房屋地址或类型 63 | * @return 64 | */ 65 | @RequestMapping("/housequery") 66 | @ResponseBody 67 | public Msg housequery(@RequestParam(value = "pn",defaultValue="1")Integer pn,String queryValue) { 68 | //设置分页传输 69 | PageHelper.startPage(pn,8); 70 | //查询所有可租凭数据 71 | List list1=leaseinformationService.selectHouseQuery(queryValue); 72 | //使用PageInFo封装查询结果 73 | PageInfo pageInfo=new PageInfo(list1,5); 74 | return Msg.success().add("pageInfo",pageInfo); 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /src/com/javabean/rentwithdrawn.java: -------------------------------------------------------------------------------- 1 | package com.javabean; 2 | 3 | public class rentwithdrawn { 4 | private Integer rwid; 5 | 6 | private String rwusername; 7 | 8 | private String rwuserid; 9 | 10 | private String rwuserphone; 11 | 12 | private String rwhouseid; 13 | 14 | private String rwhouseaddress; 15 | 16 | private Double rwhouseprice; 17 | 18 | private String rwstate; 19 | 20 | private String state1; 21 | 22 | private String state2; 23 | 24 | public String getState1() { 25 | return state1; 26 | } 27 | 28 | public void setState1(String state1) { 29 | this.state1 = state1; 30 | } 31 | 32 | public String getState2() { 33 | return state2; 34 | } 35 | 36 | public void setState2(String state2) { 37 | this.state2 = state2; 38 | } 39 | 40 | public Integer getRwid() { 41 | return rwid; 42 | } 43 | 44 | public void setRwid(Integer rwid) { 45 | this.rwid = rwid; 46 | } 47 | 48 | public String getRwusername() { 49 | return rwusername; 50 | } 51 | 52 | public void setRwusername(String rwusername) { 53 | this.rwusername = rwusername == null ? null : rwusername.trim(); 54 | } 55 | 56 | public String getRwuserid() { 57 | return rwuserid; 58 | } 59 | 60 | public void setRwuserid(String rwuserid) { 61 | this.rwuserid = rwuserid == null ? null : rwuserid.trim(); 62 | } 63 | 64 | public String getRwuserphone() { 65 | return rwuserphone; 66 | } 67 | 68 | public void setRwuserphone(String rwuserphone) { 69 | this.rwuserphone = rwuserphone == null ? null : rwuserphone.trim(); 70 | } 71 | 72 | public String getRwhouseid() { 73 | return rwhouseid; 74 | } 75 | 76 | public void setRwhouseid(String rwhouseid) { 77 | this.rwhouseid = rwhouseid == null ? null : rwhouseid.trim(); 78 | } 79 | 80 | public String getRwhouseaddress() { 81 | return rwhouseaddress; 82 | } 83 | 84 | public void setRwhouseaddress(String rwhouseaddress) { 85 | this.rwhouseaddress = rwhouseaddress == null ? null : rwhouseaddress.trim(); 86 | } 87 | 88 | public Double getRwhouseprice() { 89 | return rwhouseprice; 90 | } 91 | 92 | public void setRwhouseprice(Double rwhouseprice) { 93 | this.rwhouseprice = rwhouseprice; 94 | } 95 | 96 | public String getRwstate() { 97 | return rwstate; 98 | } 99 | 100 | public void setRwstate(String rwstate) { 101 | this.rwstate = rwstate == null ? null : rwstate.trim(); 102 | } 103 | } -------------------------------------------------------------------------------- /src/com/javabean/rentcollection.java: -------------------------------------------------------------------------------- 1 | package com.javabean; 2 | 3 | import java.util.Date; 4 | import org.springframework.format.annotation.DateTimeFormat; 5 | public class rentcollection { 6 | private Integer rcid; 7 | 8 | private String rchouseid; 9 | 10 | private String rchouseaddress; 11 | 12 | private String rchousemoney; 13 | @DateTimeFormat(pattern="yyyy-MM-dd") 14 | private Date rcdate; 15 | 16 | private String rcdatetemp; 17 | @DateTimeFormat(pattern="yyyy-MM-dd") 18 | private Date rcpaiddate; 19 | 20 | private String rcpaiddatetemp; 21 | 22 | private String rcusername; 23 | 24 | private String rcstate; 25 | 26 | //修改联表暂时保存的查询字符串 27 | private String rcusernametemp; 28 | 29 | public String getRcusernametemp() { 30 | return rcusernametemp; 31 | } 32 | 33 | public void setRcusernametemp(String rcusernametemp) { 34 | this.rcusernametemp = rcusernametemp; 35 | } 36 | 37 | public String getRcdatetemp() { 38 | return rcdatetemp; 39 | } 40 | 41 | public void setRcdatetemp(String rcdatetemp) { 42 | this.rcdatetemp = rcdatetemp; 43 | } 44 | 45 | public String getRcpaiddatetemp() { 46 | return rcpaiddatetemp; 47 | } 48 | 49 | public void setRcpaiddatetemp(String rcpaiddatetemp) { 50 | this.rcpaiddatetemp = rcpaiddatetemp; 51 | } 52 | 53 | public Date getRcpaiddate() { 54 | return rcpaiddate; 55 | } 56 | 57 | public void setRcpaiddate(Date rcpaiddate) { 58 | this.rcpaiddate = rcpaiddate; 59 | } 60 | 61 | public Integer getRcid() { 62 | return rcid; 63 | } 64 | 65 | public void setRcid(Integer rcid) { 66 | this.rcid = rcid; 67 | } 68 | 69 | public String getRchouseid() { 70 | return rchouseid; 71 | } 72 | 73 | public void setRchouseid(String rchouseid) { 74 | this.rchouseid = rchouseid; 75 | } 76 | 77 | public String getRchouseaddress() { 78 | return rchouseaddress; 79 | } 80 | 81 | public void setRchouseaddress(String rchouseaddress) { 82 | this.rchouseaddress = rchouseaddress == null ? null : rchouseaddress.trim(); 83 | } 84 | 85 | public String getRchousemoney() { 86 | return rchousemoney; 87 | } 88 | 89 | public void setRchousemoney(String rchousemoney) { 90 | this.rchousemoney = rchousemoney == null ? null : rchousemoney.trim(); 91 | } 92 | 93 | public Date getRcdate() { 94 | return rcdate; 95 | } 96 | 97 | public void setRcdate(Date rcdate) { 98 | this.rcdate = rcdate; 99 | } 100 | 101 | public String getRcusername() { 102 | return rcusername; 103 | } 104 | 105 | public void setRcusername(String rcusername) { 106 | this.rcusername = rcusername == null ? null : rcusername.trim(); 107 | } 108 | 109 | public String getRcstate() { 110 | return rcstate; 111 | } 112 | 113 | public void setRcstate(String rcstate) { 114 | this.rcstate = rcstate == null ? null : rcstate.trim(); 115 | } 116 | } -------------------------------------------------------------------------------- /src/com/javabean/checkoutapplication.java: -------------------------------------------------------------------------------- 1 | package com.javabean; 2 | 3 | public class checkoutapplication { 4 | private Integer coaid; 5 | 6 | private String coausername; 7 | 8 | private String coauserid; 9 | 10 | private String coauserphone; 11 | 12 | private String coahouseaddress; 13 | 14 | private Double coahouseprice; 15 | 16 | private String coastate; 17 | 18 | private String coahouseid; 19 | 20 | private String state1; 21 | 22 | private String state2; 23 | 24 | private String state3; 25 | 26 | private Double coahousesize; 27 | 28 | public Double getCoahousesize() { 29 | return coahousesize; 30 | } 31 | 32 | public void setCoahousesize(Double coahousesize) { 33 | this.coahousesize = coahousesize; 34 | } 35 | 36 | public String getState3() { 37 | return state3; 38 | } 39 | 40 | public void setState3(String state3) { 41 | this.state3 = state3; 42 | } 43 | 44 | public String getState1() { 45 | return state1; 46 | } 47 | 48 | public void setState1(String state1) { 49 | this.state1 = state1; 50 | } 51 | 52 | public String getState2() { 53 | return state2; 54 | } 55 | 56 | public void setState2(String state2) { 57 | this.state2 = state2; 58 | } 59 | 60 | public String getCoahouseid() { 61 | return coahouseid; 62 | } 63 | 64 | public void setCoahouseid(String coahouseid) { 65 | this.coahouseid = coahouseid; 66 | } 67 | 68 | public Integer getCoaid() { 69 | return coaid; 70 | } 71 | 72 | public void setCoaid(Integer coaid) { 73 | this.coaid = coaid; 74 | } 75 | 76 | public String getCoausername() { 77 | return coausername; 78 | } 79 | 80 | public void setCoausername(String coausername) { 81 | this.coausername = coausername == null ? null : coausername.trim(); 82 | } 83 | 84 | public String getCoauserid() { 85 | return coauserid; 86 | } 87 | 88 | public void setCoauserid(String coauserid) { 89 | this.coauserid = coauserid == null ? null : coauserid.trim(); 90 | } 91 | 92 | public String getCoauserphone() { 93 | return coauserphone; 94 | } 95 | 96 | public void setCoauserphone(String coauserphone) { 97 | this.coauserphone = coauserphone == null ? null : coauserphone.trim(); 98 | } 99 | 100 | public String getCoahouseaddress() { 101 | return coahouseaddress; 102 | } 103 | 104 | public void setCoahouseaddress(String coahouseaddress) { 105 | this.coahouseaddress = coahouseaddress == null ? null : coahouseaddress.trim(); 106 | } 107 | 108 | public Double getCoahouseprice() { 109 | return coahouseprice; 110 | } 111 | 112 | public void setCoahouseprice(Double coahouseprice) { 113 | this.coahouseprice = coahouseprice; 114 | } 115 | 116 | public String getCoastate() { 117 | return coastate; 118 | } 119 | 120 | public void setCoastate(String coastate) { 121 | this.coastate = coastate == null ? null : coastate.trim(); 122 | } 123 | } -------------------------------------------------------------------------------- /src/com/service/impl/RentcollectionMapperImpl.java: -------------------------------------------------------------------------------- 1 | package com.service.impl; 2 | /** 3 | * 缴费Serviceimpl 4 | */ 5 | import java.text.SimpleDateFormat; 6 | import java.util.Date; 7 | import java.util.List; 8 | import javax.annotation.Resource; 9 | 10 | import org.springframework.stereotype.Service; 11 | import org.springframework.transaction.annotation.Transactional; 12 | 13 | import com.currency.Warning; 14 | import com.dao.rentcollectionMapper; 15 | import com.javabean.QueryVo; 16 | import com.javabean.rentcollection; 17 | import com.service.RentcollectionService; 18 | 19 | @Service("rentcollectionService") 20 | @Transactional 21 | public class RentcollectionMapperImpl implements RentcollectionService { 22 | 23 | @Resource 24 | private rentcollectionMapper rentcollectionMapper; 25 | 26 | @Override 27 | public List queryPaidStateAll(String state,String name) { 28 | rentcollection rentcollection=new rentcollection(); 29 | rentcollection.setRcstate(state); 30 | rentcollection.setRcusername(name); 31 | List templist=rentcollectionMapper.selectPaidStateNameAll(rentcollection); 32 | for(rentcollection temp:templist) { 33 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); 34 | String Rcdate = sdf.format(temp.getRcdate()); 35 | temp.setRcdatetemp(Rcdate); 36 | if(temp.getRcpaiddate()!=null) { 37 | String Rcpaiddate = sdf.format(temp.getRcpaiddate()); 38 | temp.setRcpaiddatetemp(Rcpaiddate); 39 | } 40 | } 41 | return templist; 42 | } 43 | 44 | @Override 45 | public Warning deleteByPrimaryKey(Integer rcid) { 46 | return rentcollectionMapper.deleteByPrimaryKey(rcid)>0?new Warning(0, "删除成功!"):new Warning(2, "删除失败"); 47 | } 48 | 49 | @Override 50 | public void insert(rentcollection record) { 51 | record.setRcstate("未缴纳"); 52 | rentcollectionMapper.insert(record); 53 | } 54 | 55 | @Override 56 | public List selectPaidStateAll(String rcstate) { 57 | rentcollection record = new rentcollection(); 58 | record.setRcstate(rcstate); 59 | List rentlist= rentcollectionMapper.selectPaidStateAll(record); 60 | for(rentcollection temp:rentlist) { 61 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); 62 | String date = sdf.format(temp.getRcdate()); 63 | temp.setRcdatetemp(date); 64 | } 65 | return rentlist; 66 | } 67 | 68 | @Override 69 | public List selectPaidAll(QueryVo vo) { 70 | List list = rentcollectionMapper.selectPaidAll(vo); 71 | return list; 72 | } 73 | 74 | @Override 75 | public String updateUserName(String username,String rcusernametemp) { 76 | rentcollection record=new rentcollection(); 77 | record.setRcusername(username); 78 | record.setRcusernametemp(rcusernametemp); 79 | return rentcollectionMapper.updateUserName(record)>0?"修改租金真实姓名成功":"修改租金真实姓名失败"; 80 | } 81 | 82 | @Override 83 | public Warning updateState(Integer rchouseid) { 84 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); 85 | String datetemp=sdf.format(new Date()); 86 | return rentcollectionMapper.updateState(rchouseid,datetemp)>0?new Warning(0, "支付成功!"):new Warning(2, "支付失败"); 87 | } 88 | 89 | } 90 | -------------------------------------------------------------------------------- /src/com/javabean/fault.java: -------------------------------------------------------------------------------- 1 | package com.javabean; 2 | 3 | import java.util.Date; 4 | 5 | public class fault { 6 | private Integer fid; 7 | 8 | private String fhouseid; 9 | 10 | private String fhouseaddress; 11 | 12 | private Double fprice; 13 | 14 | private Date fdate; 15 | 16 | private String fdatetemp; 17 | 18 | private String fcontent; 19 | 20 | private String fusername; 21 | 22 | private String fuserid; 23 | 24 | private String fuserphone; 25 | 26 | private String fstate; 27 | 28 | public String getFdatetemp() { 29 | return fdatetemp; 30 | } 31 | 32 | public void setFdatetemp(String fdatetemp) { 33 | this.fdatetemp = fdatetemp; 34 | } 35 | 36 | public Integer getFid() { 37 | return fid; 38 | } 39 | 40 | public void setFid(Integer fid) { 41 | this.fid = fid; 42 | } 43 | 44 | public String getFhouseid() { 45 | return fhouseid; 46 | } 47 | 48 | public void setFhouseid(String fhouseid) { 49 | this.fhouseid = fhouseid == null ? null : fhouseid.trim(); 50 | } 51 | 52 | public String getFhouseaddress() { 53 | return fhouseaddress; 54 | } 55 | 56 | public void setFhouseaddress(String fhouseaddress) { 57 | this.fhouseaddress = fhouseaddress == null ? null : fhouseaddress.trim(); 58 | } 59 | 60 | public Double getFprice() { 61 | return fprice; 62 | } 63 | 64 | public void setFprice(Double fprice) { 65 | this.fprice = fprice; 66 | } 67 | 68 | public Date getFdate() { 69 | return fdate; 70 | } 71 | 72 | public void setFdate(Date fdate) { 73 | this.fdate = fdate; 74 | } 75 | 76 | public String getFcontent() { 77 | return fcontent; 78 | } 79 | 80 | public void setFcontent(String fcontent) { 81 | this.fcontent = fcontent == null ? null : fcontent.trim(); 82 | } 83 | 84 | public String getFusername() { 85 | return fusername; 86 | } 87 | 88 | public void setFusername(String fusername) { 89 | this.fusername = fusername == null ? null : fusername.trim(); 90 | } 91 | 92 | public String getFuserid() { 93 | return fuserid; 94 | } 95 | 96 | public void setFuserid(String fuserid) { 97 | this.fuserid = fuserid == null ? null : fuserid.trim(); 98 | } 99 | 100 | public String getFuserphone() { 101 | return fuserphone; 102 | } 103 | 104 | public void setFuserphone(String fuserphone) { 105 | this.fuserphone = fuserphone == null ? null : fuserphone.trim(); 106 | } 107 | 108 | public String getFstate() { 109 | return fstate; 110 | } 111 | 112 | public void setFstate(String fstate) { 113 | this.fstate = fstate == null ? null : fstate.trim(); 114 | } 115 | 116 | public fault() { 117 | // TODO Auto-generated constructor stub 118 | } 119 | 120 | public fault(String fhouseid, String fhouseaddress, Double fprice, Date fdate, 121 | String fcontent, String fusername, String fuserid, String fuserphone, String fstate,Integer fid) { 122 | super(); 123 | this.fid = fid; 124 | this.fhouseid = fhouseid; 125 | this.fhouseaddress = fhouseaddress; 126 | this.fprice = fprice; 127 | this.fdate = fdate; 128 | this.fcontent = fcontent; 129 | this.fusername = fusername; 130 | this.fuserid = fuserid; 131 | this.fuserphone = fuserphone; 132 | this.fstate = fstate; 133 | } 134 | 135 | } -------------------------------------------------------------------------------- /.settings/org.springframework.ide.eclipse.xml.namespaces.prefs: -------------------------------------------------------------------------------- 1 | //org.springframework.ide.eclipse.xml.namespaces.default.version.http\://mybatis.org/schema/mybatis-spring= 2 | //org.springframework.ide.eclipse.xml.namespaces.default.version.http\://www.springframework.org/schema/aop= 3 | //org.springframework.ide.eclipse.xml.namespaces.default.version.http\://www.springframework.org/schema/beans= 4 | //org.springframework.ide.eclipse.xml.namespaces.default.version.http\://www.springframework.org/schema/c= 5 | //org.springframework.ide.eclipse.xml.namespaces.default.version.http\://www.springframework.org/schema/cache= 6 | //org.springframework.ide.eclipse.xml.namespaces.default.version.http\://www.springframework.org/schema/context= 7 | //org.springframework.ide.eclipse.xml.namespaces.default.version.http\://www.springframework.org/schema/jdbc= 8 | //org.springframework.ide.eclipse.xml.namespaces.default.version.http\://www.springframework.org/schema/jee= 9 | //org.springframework.ide.eclipse.xml.namespaces.default.version.http\://www.springframework.org/schema/lang= 10 | //org.springframework.ide.eclipse.xml.namespaces.default.version.http\://www.springframework.org/schema/mvc= 11 | //org.springframework.ide.eclipse.xml.namespaces.default.version.http\://www.springframework.org/schema/p= 12 | //org.springframework.ide.eclipse.xml.namespaces.default.version.http\://www.springframework.org/schema/task= 13 | //org.springframework.ide.eclipse.xml.namespaces.default.version.http\://www.springframework.org/schema/tx= 14 | //org.springframework.ide.eclipse.xml.namespaces.default.version.http\://www.springframework.org/schema/util= 15 | //org.springframework.ide.eclipse.xml.namespaces.prefix.http\://mybatis.org/schema/mybatis-spring=mybatis-spring 16 | //org.springframework.ide.eclipse.xml.namespaces.prefix.http\://www.springframework.org/schema/aop=aop 17 | //org.springframework.ide.eclipse.xml.namespaces.prefix.http\://www.springframework.org/schema/beans=beans 18 | //org.springframework.ide.eclipse.xml.namespaces.prefix.http\://www.springframework.org/schema/c=c 19 | //org.springframework.ide.eclipse.xml.namespaces.prefix.http\://www.springframework.org/schema/cache=cache 20 | //org.springframework.ide.eclipse.xml.namespaces.prefix.http\://www.springframework.org/schema/context=context 21 | //org.springframework.ide.eclipse.xml.namespaces.prefix.http\://www.springframework.org/schema/jdbc=jdbc 22 | //org.springframework.ide.eclipse.xml.namespaces.prefix.http\://www.springframework.org/schema/jee=jee 23 | //org.springframework.ide.eclipse.xml.namespaces.prefix.http\://www.springframework.org/schema/lang=lang 24 | //org.springframework.ide.eclipse.xml.namespaces.prefix.http\://www.springframework.org/schema/mvc=mvc 25 | //org.springframework.ide.eclipse.xml.namespaces.prefix.http\://www.springframework.org/schema/p=p 26 | //org.springframework.ide.eclipse.xml.namespaces.prefix.http\://www.springframework.org/schema/task=task 27 | //org.springframework.ide.eclipse.xml.namespaces.prefix.http\://www.springframework.org/schema/tx=tx 28 | //org.springframework.ide.eclipse.xml.namespaces.prefix.http\://www.springframework.org/schema/util=util 29 | eclipse.preferences.version=1 30 | org.springframework.ide.eclipse.xml.namespaces.default.version.check.classpath=true 31 | org.springframework.ide.eclipse.xml.namespaces.enable.project.preferences=false 32 | org.springframework.ide.eclipse.xml.namespaces.loadNamespaceHandlerFromClasspath=true 33 | org.springframework.ide.eclipse.xml.namespaces.use.https.for.new.namespace.locations=false 34 | -------------------------------------------------------------------------------- /src/com/service/impl/LeaseinformationMapperImpl.java: -------------------------------------------------------------------------------- 1 | package com.service.impl; 2 | import java.text.SimpleDateFormat; 3 | /** 4 | * 官网Serviceimpl 5 | */ 6 | import java.util.List; 7 | 8 | import javax.annotation.Resource; 9 | 10 | import org.springframework.stereotype.Service; 11 | import org.springframework.transaction.annotation.Transactional; 12 | 13 | import com.dao.leaseinformationMapper; 14 | import com.javabean.leaseinformation; 15 | import com.service.LeaseinformationService; 16 | @Service("leaseinformationService") 17 | @Transactional 18 | public class LeaseinformationMapperImpl implements LeaseinformationService { 19 | 20 | @Resource 21 | private leaseinformationMapper leaseinformationMapper; 22 | 23 | @Override 24 | public void addHouse(leaseinformation record) { 25 | leaseinformationMapper.insert(record); 26 | } 27 | 28 | @Override 29 | public List queryAll() { 30 | return leaseinformationMapper.selectAll(); 31 | } 32 | 33 | @Override 34 | public List queryNameAll(String name) { 35 | return leaseinformationMapper.selectNameAll(name); 36 | } 37 | 38 | @Override 39 | public List queryID(Integer id) { 40 | return leaseinformationMapper.selectByPrimaryKey1(id); 41 | } 42 | 43 | @Override 44 | public List allANDimg() { 45 | return leaseinformationMapper.selectAllWith(); 46 | } 47 | @Override 48 | public List allANDimg1(Integer id) { 49 | return leaseinformationMapper.selectByPrimaryKeyWith(id); 50 | } 51 | 52 | @Override 53 | public List selecthousteaseWith(String steate) { 54 | List list=leaseinformationMapper.selecthousteaseWith(steate); 55 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); 56 | for(leaseinformation temp:list) { 57 | String date1 = sdf.format(temp.getHousestartingdate()); 58 | String date2 = sdf.format(temp.getHouseclosingdate()); 59 | temp.setHousestartingdatetemp(date1); 60 | temp.setHouseclosingdatetemp(date2); 61 | } 62 | return list; 63 | } 64 | 65 | @Override 66 | public boolean updacontract(Integer id) { 67 | return leaseinformationMapper.updacontract(id); 68 | } 69 | 70 | @Override 71 | public int updateByPrimaryKey(leaseinformation record) { 72 | return leaseinformationMapper.updateByPrimaryKey(record); 73 | } 74 | 75 | @Override 76 | public int deleteByPrimaryKey(Integer id) { 77 | return leaseinformationMapper.deleteByPrimaryKey(id); 78 | } 79 | 80 | @Override 81 | public List selectRecommend() { 82 | return leaseinformationMapper.selectRecommend(); 83 | } 84 | 85 | @Override 86 | public List selectHouseCall(String housecall) { 87 | return leaseinformationMapper.selectHouseCall(housecall); 88 | } 89 | 90 | @Override 91 | public List selectState(String state) { 92 | return leaseinformationMapper.selectState(state); 93 | } 94 | 95 | @Override 96 | public String updateCancelForeignKey(String housecall) { 97 | return leaseinformationMapper.updateCancelForeignKey(housecall)>0?"已删除该外键":"外键删除失败"; 98 | } 99 | 100 | @Override 101 | public List selectHouseQuery(String housequery) { 102 | return leaseinformationMapper.selectHouseQuery(housequery); 103 | } 104 | 105 | @Override 106 | public List selectAllLeasable() { 107 | return leaseinformationMapper.selectAllLeasable(); 108 | } 109 | 110 | } 111 | -------------------------------------------------------------------------------- /src/com/service/impl/UserlistMapperImpl.java: -------------------------------------------------------------------------------- 1 | package com.service.impl; 2 | import java.text.SimpleDateFormat; 3 | import java.util.List; 4 | 5 | /** 6 | * 用户Serviceimpl 7 | */ 8 | import javax.annotation.Resource; 9 | 10 | import org.springframework.stereotype.Service; 11 | import org.springframework.transaction.annotation.Transactional; 12 | 13 | import com.currency.Warning; 14 | import com.dao.userlistMapper; 15 | import com.javabean.fault; 16 | import com.javabean.userlist; 17 | import com.service.UserlistService; 18 | @Service("userlistService") 19 | @Transactional 20 | public class UserlistMapperImpl implements UserlistService{ 21 | 22 | @Resource 23 | private userlistMapper userlistMapper; 24 | 25 | @Override 26 | public userlist queryAllUserPwd(userlist record) { 27 | return userlistMapper.selectUserPwd(record); 28 | } 29 | 30 | @Override 31 | public userlist selectUserCall(String usercall) { 32 | return userlistMapper.selectUserCall(usercall); 33 | } 34 | 35 | @Override 36 | public List selectUserNameWith(String username) { 37 | List userlist=userlistMapper.selectUserNameWith(username); 38 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); 39 | for(userlist temp:userlist) { 40 | String date1 = sdf.format(temp.getLeaseinformation().getHousestartingdate()); 41 | String date2 = sdf.format(temp.getLeaseinformation().getHouseclosingdate()); 42 | temp.getLeaseinformation().setHousestartingdatetemp(date1); 43 | temp.getLeaseinformation().setHouseclosingdatetemp(date2); 44 | } 45 | return userlist; 46 | } 47 | 48 | @Override 49 | public userlist selectUserCallWith(String housecall) { 50 | return userlistMapper.selectHouseCallWith(housecall); 51 | } 52 | @Override 53 | public int insert(userlist record) { 54 | return userlistMapper.insert(record); 55 | } 56 | 57 | @Override 58 | public userlist selectUserPhone(String userphone) { 59 | return userlistMapper.selectUserPhone(userphone); 60 | } 61 | 62 | @Override 63 | public int updatepwd(userlist record) { 64 | 65 | return userlistMapper.updateByPrimaryKey(record); 66 | } 67 | 68 | @Override 69 | public Warning updateByPrimaryCall(userlist record) { 70 | if(record.getUsercall().equals("")&&record.getUsername().equals("")&&record.getUserid().equals("")&&record.getUserphone().equals("")) { 71 | return new Warning(1, "请输入真实姓名,身份证,手机号对应的有效值"); 72 | } 73 | return userlistMapper.updateByPrimaryCall(record)>0?new Warning(0, "上传成功!"):new Warning(2, "上传失败!"); 74 | } 75 | 76 | @Override 77 | public List selectAll() { 78 | return userlistMapper.selectAll(); 79 | } 80 | 81 | @Override 82 | public int deleteByPrimaryKey(Integer id) { 83 | return userlistMapper.deleteByPrimaryKey(id); 84 | } 85 | 86 | @Override 87 | public userlist selectUserId(Integer userid) { 88 | return userlistMapper.selectUserId(userid); 89 | } 90 | @Override 91 | public List rentSelectAll() { 92 | return userlistMapper.rentSelectAll(); 93 | } 94 | 95 | @Override 96 | public Warning updateJointTableName(userlist record) { 97 | if(record.getUsername().equals("")&&record.getUserid().equals("")&&record.getUserphone().equals("")) { 98 | return new Warning(1, "请输入真实姓名,身份证,手机号对应的有效值"); 99 | } 100 | return userlistMapper.updateJointTableName(record)>0?new Warning(0, "修改成功!"):new Warning(2, "修改失败!"); 101 | } 102 | 103 | @Override 104 | public String updateJointTabledelete(String username) { 105 | return userlistMapper.updateJointTabledelete(username)>0?"删除成功":"删除失败"; 106 | } 107 | 108 | @Override 109 | public userlist selectUserName(String username) { 110 | return userlistMapper.selectUserName(username); 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /src/com/controller/PayController.java: -------------------------------------------------------------------------------- 1 | package com.controller; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.RequestMethod; 6 | import org.springframework.web.servlet.ModelAndView; 7 | 8 | import java.io.UnsupportedEncodingException; 9 | import java.util.HashMap; 10 | import java.util.Iterator; 11 | import java.util.Map; 12 | 13 | import javax.annotation.Resource; 14 | import javax.servlet.http.HttpServletRequest; 15 | import javax.servlet.http.HttpServletResponse; 16 | import javax.servlet.http.HttpSession; 17 | 18 | import com.javabean.AlipayConfig; 19 | import com.javabean.headportraitimg; 20 | import com.service.HeadPortraitImgService; 21 | import com.service.RentcollectionService; 22 | import com.alipay.api.AlipayApiException; 23 | import com.alipay.api.internal.util.AlipaySignature; 24 | import com.currency.Warning; 25 | 26 | @Controller 27 | @RequestMapping("/alipaymvc") 28 | public class PayController { 29 | 30 | @Resource 31 | private RentcollectionService rentcollectionService; 32 | 33 | @Resource 34 | private HeadPortraitImgService headPortraitImgService; 35 | 36 | /** 37 | * 回调并缴纳租金 38 | */ 39 | @RequestMapping(value = "/returnUrl", method = RequestMethod.GET) 40 | public ModelAndView returnUrl(HttpServletRequest request, HttpServletResponse response,HttpSession session) throws UnsupportedEncodingException, AlipayApiException { 41 | session.setAttribute("user", AlipayConfig.usercall); 42 | headportraitimg headportraitimg = headPortraitImgService.selectheadportrait(AlipayConfig.usercall); 43 | if (headportraitimg.getHeadportraitimgaddress() != null) { 44 | session.setAttribute("headportraitimg", headportraitimg.getHeadportraitimgaddress()); 45 | } 46 | ModelAndView mav = new ModelAndView("redirect:/jsp/personacenter.jsp"); 47 | // 获取支付宝GET过来反馈信息 48 | Map params = new HashMap(); 49 | Map requestParams = request.getParameterMap(); 50 | for (Iterator iter = requestParams.keySet().iterator(); iter.hasNext();) { 51 | String name = (String) iter.next(); 52 | String[] values = (String[]) requestParams.get(name); 53 | String valueStr = ""; 54 | for (int i = 0; i < values.length; i++) { 55 | valueStr = (i == values.length - 1) ? valueStr + values[i] : valueStr + values[i] + ","; 56 | } 57 | // 乱码解决,这段代码在出现乱码时使用 58 | valueStr = new String(valueStr.getBytes("utf-8"), "utf-8"); 59 | params.put(name, valueStr); 60 | } 61 | 62 | System.out.println(params);//查看参数都有哪些 63 | boolean signVerified = AlipaySignature.rsaCheckV1(params, AlipayConfig.alipay_public_key, AlipayConfig.charset, AlipayConfig.sign_type); // 调用SDK验证签名 64 | //验证签名通过 65 | if(signVerified){ 66 | // 商户订单号 67 | String out_trade_no = new String(request.getParameter("out_trade_no").getBytes("ISO-8859-1"), "UTF-8"); 68 | 69 | // 支付宝交易号 70 | String trade_no = new String(request.getParameter("trade_no").getBytes("ISO-8859-1"), "UTF-8"); 71 | 72 | // 付款金额 73 | String total_amount = new String(request.getParameter("total_amount").getBytes("ISO-8859-1"), "UTF-8"); 74 | 75 | 76 | System.out.println("商户订单号="+out_trade_no); 77 | System.out.println("支付宝交易号="+trade_no); 78 | System.out.println("付款金额="+total_amount); 79 | 80 | /** 81 | * 缴纳租金 82 | */ 83 | Warning news = rentcollectionService.updateState(Integer.parseInt(AlipayConfig.rcid)); 84 | System.out.println(news.getWarningContent()); 85 | }else{ 86 | mav.addObject("news", new Warning(2, "支付失败!")); 87 | } 88 | return mav; 89 | } 90 | 91 | } -------------------------------------------------------------------------------- /src/com/javabean/leaseinformation.java: -------------------------------------------------------------------------------- 1 | package com.javabean; 2 | 3 | import java.util.Date; 4 | 5 | public class leaseinformation { 6 | private Integer houseid; 7 | 8 | private String housecall; 9 | 10 | private String houseaddress; 11 | 12 | private String housetype; 13 | 14 | private Double housesize; 15 | 16 | private String housemoney; 17 | 18 | private String housestate; 19 | 20 | private Date housestartingdate; 21 | 22 | private Date houseclosingdate; 23 | 24 | private String housestartingdatetemp; 25 | 26 | private String houseclosingdatetemp; 27 | 28 | private Integer id; 29 | 30 | private String username; 31 | 32 | private String houserecommend; 33 | // 希望查询房屋信息的同时房屋的图片链接也是查询好的 34 | private leaseimg leaseimg; 35 | private userlist userlist; 36 | 37 | 38 | public userlist getUserlist() { 39 | return userlist; 40 | } 41 | 42 | public void setUserlist(userlist userlist) { 43 | this.userlist = userlist; 44 | } 45 | 46 | public String getHouserecommend() { 47 | return houserecommend; 48 | } 49 | 50 | public void setHouserecommend(String houserecommend) { 51 | this.houserecommend = houserecommend; 52 | } 53 | 54 | public leaseimg getLeaseimg() { 55 | return leaseimg; 56 | } 57 | 58 | public void setLeaseimg(leaseimg leaseimg) { 59 | this.leaseimg = leaseimg; 60 | } 61 | 62 | public String getHousecall() { 63 | return housecall; 64 | } 65 | 66 | public void setHousecall(String housecall) { 67 | this.housecall = housecall; 68 | } 69 | 70 | public Integer getHouseid() { 71 | return houseid; 72 | } 73 | 74 | public void setHouseid(Integer houseid) { 75 | this.houseid = houseid; 76 | } 77 | 78 | public String getHouseaddress() { 79 | return houseaddress; 80 | } 81 | 82 | public void setHouseaddress(String houseaddress) { 83 | this.houseaddress = houseaddress == null ? null : houseaddress.trim(); 84 | } 85 | 86 | public String getHousetype() { 87 | return housetype; 88 | } 89 | 90 | public void setHousetype(String housetype) { 91 | this.housetype = housetype == null ? null : housetype.trim(); 92 | } 93 | 94 | public Double getHousesize() { 95 | return housesize; 96 | } 97 | 98 | public void setHousesize(Double housesize) { 99 | this.housesize = housesize; 100 | } 101 | 102 | public String getHousemoney() { 103 | return housemoney; 104 | } 105 | 106 | public void setHousemoney(String housemoney) { 107 | this.housemoney = housemoney == null ? null : housemoney.trim(); 108 | } 109 | 110 | public String getHousestate() { 111 | return housestate; 112 | } 113 | 114 | public void setHousestate(String housestate) { 115 | this.housestate = housestate == null ? null : housestate.trim(); 116 | } 117 | 118 | public Integer getId() { 119 | return id; 120 | } 121 | 122 | public void setId(Integer id) { 123 | this.id = id; 124 | } 125 | 126 | public String getUsername() { 127 | return username; 128 | } 129 | 130 | public void setUsername(String username) { 131 | this.username = username; 132 | } 133 | 134 | public Date getHousestartingdate() { 135 | return housestartingdate; 136 | } 137 | 138 | public void setHousestartingdate(Date housestartingdate) { 139 | this.housestartingdate = housestartingdate; 140 | } 141 | 142 | public Date getHouseclosingdate() { 143 | return houseclosingdate; 144 | } 145 | 146 | public void setHouseclosingdate(Date houseclosingdate) { 147 | this.houseclosingdate = houseclosingdate; 148 | } 149 | 150 | public String getHousestartingdatetemp() { 151 | return housestartingdatetemp; 152 | } 153 | 154 | public void setHousestartingdatetemp(String housestartingdatetemp) { 155 | this.housestartingdatetemp = housestartingdatetemp; 156 | } 157 | 158 | public String getHouseclosingdatetemp() { 159 | return houseclosingdatetemp; 160 | } 161 | 162 | public void setHouseclosingdatetemp(String houseclosingdatetemp) { 163 | this.houseclosingdatetemp = houseclosingdatetemp; 164 | } 165 | 166 | } -------------------------------------------------------------------------------- /src/com/service/impl/CheckoutapplicationMapperImpl.java: -------------------------------------------------------------------------------- 1 | package com.service.impl; 2 | /** 3 | * 退房申请中Serviceimpl 4 | */ 5 | import java.util.List; 6 | import javax.annotation.Resource; 7 | 8 | import org.springframework.stereotype.Service; 9 | import org.springframework.transaction.annotation.Transactional; 10 | 11 | import com.currency.Warning; 12 | import com.dao.checkoutapplicationMapper; 13 | import com.javabean.checkoutapplication; 14 | import com.javabean.userlist; 15 | import com.service.CheckoutapplicationService; 16 | 17 | @Service("checkoutapplicationService") 18 | @Transactional 19 | public class CheckoutapplicationMapperImpl implements CheckoutapplicationService { 20 | 21 | @Resource 22 | private checkoutapplicationMapper checkoutapplicationMapper; 23 | 24 | @Override 25 | public List findAll() { 26 | return checkoutapplicationMapper.selectAll(); 27 | } 28 | 29 | @Override 30 | public List selectStateAll(String State1,String State2,String State3,String Name) { 31 | checkoutapplication checkoutapplication=new checkoutapplication(); 32 | checkoutapplication.setState1(State1); 33 | checkoutapplication.setState2(State2); 34 | checkoutapplication.setState3(State3); 35 | checkoutapplication.setCoausername(Name); 36 | return checkoutapplicationMapper.selectStateAll(checkoutapplication); 37 | } 38 | 39 | @Override 40 | public Warning insert(userlist userlist) { 41 | //判断是否已经申请了 42 | checkoutapplication coa=new checkoutapplication(); 43 | coa.setCoahouseid(userlist.getLeaseinformation().getHousecall()); 44 | coa.setCoastate("申请中"); 45 | checkoutapplication temp = checkoutapplicationMapper.selectCallState(coa); 46 | if(temp!=null) { 47 | return new Warning(1, "该房已申请过退租!请等待审批!"); 48 | } 49 | checkoutapplication checkoutapplication=new checkoutapplication(); 50 | checkoutapplication.setCoausername(userlist.getUsername()); 51 | checkoutapplication.setCoauserid(userlist.getUserid()); 52 | checkoutapplication.setCoauserphone(userlist.getUserphone()); 53 | checkoutapplication.setCoahouseid(userlist.getLeaseinformation().getHousecall()); 54 | checkoutapplication.setCoahouseaddress(userlist.getLeaseinformation().getHouseaddress()); 55 | checkoutapplication.setCoahouseprice(Double.parseDouble(userlist.getLeaseinformation().getHousemoney())); 56 | checkoutapplication.setCoahousesize(userlist.getLeaseinformation().getHousesize()); 57 | checkoutapplication.setCoastate("退房申请中"); 58 | 59 | checkoutapplicationMapper.insert(checkoutapplication); 60 | return new Warning(1, "已申请退租!"); 61 | } 62 | 63 | @Override 64 | public Warning updateCallState(String coastate,String coahouseid) { 65 | checkoutapplication checkoutapplication=new checkoutapplication(); 66 | checkoutapplication.setCoastate(coastate); 67 | checkoutapplication.setCoahouseid(coahouseid); 68 | return checkoutapplicationMapper.updateCallState(checkoutapplication)>0?new Warning(1,"终止申请成功!"):new Warning(2,"终止申请失败!"); 69 | } 70 | 71 | @Override 72 | public Warning deleteByPrimaryKey(Integer coaid) { 73 | return checkoutapplicationMapper.deleteByPrimaryKey(coaid)>0?new Warning(0,"删除成功!"):new Warning(2,"删除失败!"); 74 | } 75 | 76 | @Override 77 | public String insertApply(checkoutapplication checkoutapplication) { 78 | return checkoutapplicationMapper.insert(checkoutapplication)>0?"申请成功!":"申请失败!"; 79 | } 80 | 81 | @Override 82 | public List selectCoaState() { 83 | return checkoutapplicationMapper.selectCoaState(); 84 | } 85 | 86 | @Override 87 | public boolean xgaiCoaState(String coastate, Integer coaid) { 88 | checkoutapplication checkoutapplication=new checkoutapplication(); 89 | checkoutapplication.setCoastate(coastate); 90 | checkoutapplication.setCoaid(coaid); 91 | return checkoutapplicationMapper.xgaiCoaState(checkoutapplication); 92 | } 93 | 94 | @Override 95 | public List selectCoaState1() { 96 | return checkoutapplicationMapper.selectCoaState1(); 97 | } 98 | 99 | @Override 100 | public String updateState(String coastate, Integer coaid) { 101 | checkoutapplication checkoutapplication=new checkoutapplication(); 102 | checkoutapplication.setCoastate(coastate); 103 | checkoutapplication.setCoaid(coaid); 104 | if(coastate.equals("已同意")) { 105 | return checkoutapplicationMapper.updateState(checkoutapplication)>0?"同意退租成功!":"同意退租失败!"; 106 | }else if(coastate.equals("已拒绝")){ 107 | return checkoutapplicationMapper.updateState(checkoutapplication)>0?"拒绝退租成功!":"拒绝退租失败!"; 108 | } 109 | return "异常"; 110 | } 111 | 112 | } 113 | -------------------------------------------------------------------------------- /.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /src/com/currency/DocumentConversion.java: -------------------------------------------------------------------------------- 1 | package com.currency; 2 | 3 | import java.io.File; 4 | import java.io.FileNotFoundException; 5 | 6 | import org.springframework.util.ResourceUtils; 7 | 8 | import com.jacob.activeX.ActiveXComponent; 9 | import com.jacob.com.ComThread; 10 | import com.jacob.com.Dispatch; 11 | import com.jacob.com.Variant; 12 | 13 | /** 14 | * 生成word合同文档,并转换为pdf类型 15 | * 16 | * @author Administrator 17 | * 18 | */ 19 | public class DocumentConversion { 20 | 21 | /** 22 | * 文档生成 23 | */ 24 | public boolean DocumentGeneration(String[] array) { 25 | ComThread.InitSTA(); 26 | File file = null; 27 | try { 28 | file = ResourceUtils.getFile("classpath:房屋合同模板.doc"); 29 | } catch (FileNotFoundException e) { 30 | // TODO Auto-generated catch block 31 | e.printStackTrace(); 32 | return false; 33 | } 34 | ActiveXComponent app = new ActiveXComponent("Word.Application"); // 启动word 35 | String inFile = file.getAbsolutePath(); // 要替换的word文件 36 | // 要保存的目标文件 37 | String tpFile = "C://cnqf/contract/word/" + (array[0]+array[7]) + "word.doc"; 38 | Dispatch docs = null; 39 | Dispatch doc = null; 40 | try { 41 | app.setProperty("Visible", new Variant(false)); // 设置word不可见 42 | docs = app.getProperty("Documents").toDispatch(); 43 | doc = Dispatch.invoke(docs, "Open", Dispatch.Method, 44 | new Object[] { inFile, new Variant(false), new Variant(false) }, new int[1]).toDispatch(); // 打开word文件,注意这里第三个参数要设为false,这个参数表示是否以只读方式打开,因为我们要保存原文件,所以以可写方式打开。 45 | Dispatch selection = app.getProperty("Selection").toDispatch();// 获得对Selection组件 46 | Dispatch.call(selection, "HomeKey", new Variant(6));// 移到开头 47 | Dispatch find = Dispatch.call(selection, "Find").toDispatch();// 获得Find组件 48 | // 替换 49 | Dispatch.put(find, "Text", "admin"); // 查找字符串 50 | Dispatch.call(find, "Execute"); // 执行查询 51 | Dispatch.put(selection, "Text", "管理员"); // 替换 52 | 53 | Dispatch.put(find, "Text", "user"); // 查找字符串 54 | Dispatch.call(find, "Execute"); // 执行查询 55 | Dispatch.put(selection, "Text", array[0]); // 替换 56 | 57 | Dispatch.put(find, "Text", "userid"); // 查找字符串 58 | Dispatch.call(find, "Execute"); // 执行查询 59 | Dispatch.put(selection, "Text", array[1]); // 替换 60 | 61 | Dispatch.put(find, "Text", "houseadd"); // 查找字符串 62 | Dispatch.call(find, "Execute"); // 执行查询 63 | Dispatch.put(selection, "Text", array[2]); // 替换 64 | 65 | String[] temp = array[3].split("-"); 66 | Dispatch.put(find, "Text", "year1"); // 查找字符串 67 | Dispatch.call(find, "Execute"); // 执行查询 68 | Dispatch.put(selection, "Text", temp[0]); // 替换 69 | 70 | Dispatch.put(find, "Text", "month1"); // 查找字符串 71 | Dispatch.call(find, "Execute"); // 执行查询 72 | Dispatch.put(selection, "Text", temp[1]); // 替换 73 | 74 | Dispatch.put(find, "Text", "day1"); // 查找字符串 75 | Dispatch.call(find, "Execute"); // 执行查询 76 | Dispatch.put(selection, "Text", temp[2]); // 替换 77 | 78 | String[] temp2 = array[4].split("-"); 79 | Dispatch.put(find, "Text", "year2"); // 查找字符串 80 | Dispatch.call(find, "Execute"); // 执行查询 81 | Dispatch.put(selection, "Text", temp2[0]); // 替换 82 | 83 | Dispatch.put(find, "Text", "month2"); // 查找字符串 84 | Dispatch.call(find, "Execute"); // 执行查询 85 | Dispatch.put(selection, "Text", temp2[1]); // 替换 86 | 87 | Dispatch.put(find, "Text", "day2"); // 查找字符串 88 | Dispatch.call(find, "Execute"); // 执行查询 89 | Dispatch.put(selection, "Text", temp2[2]); // 替换 90 | 91 | Dispatch.put(find, "Text", "monthlyRent"); // 查找字符串 92 | Dispatch.call(find, "Execute"); // 执行查询 93 | Dispatch.put(selection, "Text", String.format("%.2f", Double.parseDouble(array[5]))); // 替换 94 | 95 | double tempmonth = Double.parseDouble(array[5]); 96 | double tempmonthsum = tempmonth; 97 | tempmonth *= 0.2; 98 | Dispatch.put(find, "Text", "deposit"); // 查找字符串 99 | Dispatch.call(find, "Execute"); // 执行查询 100 | Dispatch.put(selection, "Text", String.format("%.2f", tempmonth)); // 替换 101 | 102 | tempmonthsum += tempmonth; 103 | Dispatch.put(find, "Text", "sumPrice"); // 查找字符串 104 | Dispatch.call(find, "Execute"); // 执行查询 105 | Dispatch.put(selection, "Text", String.format("%.2f", tempmonthsum)); // 替换 106 | 107 | Dispatch.put(find, "Text", "admin2"); // 查找字符串 108 | Dispatch.call(find, "Execute"); // 执行查询 109 | Dispatch.put(selection, "Text", "管理员"); // 替换 110 | 111 | Dispatch.put(find, "Text", "user2"); // 查找字符串 112 | Dispatch.call(find, "Execute"); // 执行查询 113 | Dispatch.put(selection, "Text", array[0]); // 替换 114 | 115 | Dispatch.put(find, "Text", "adminphone"); // 查找字符串 116 | Dispatch.call(find, "Execute"); // 执行查询 117 | Dispatch.put(selection, "Text", "13667446303"); // 替换 118 | 119 | Dispatch.put(find, "Text", "userphone"); // 查找字符串 120 | Dispatch.call(find, "Execute"); // 执行查询 121 | Dispatch.put(selection, "Text", array[6]); // 替换 122 | // 保存文件 123 | Dispatch.invoke(doc, "SaveAs", Dispatch.Method, new Object[] { tpFile, new Variant(0) }, new int[1]); // new 124 | } catch (Exception e) { 125 | e.printStackTrace(); 126 | return false; 127 | } finally { 128 | if (app != null) { 129 | app.invoke("Quit", new Variant[] {}); 130 | app.safeRelease(); 131 | docs.safeRelease(); 132 | doc.safeRelease(); 133 | } 134 | ComThread.Release(); 135 | } 136 | return true; 137 | } 138 | 139 | /** 140 | * pdf生成 141 | */ 142 | public void PdfGeneration(String userid) { 143 | ActiveXComponent app = null; 144 | 145 | String wordFile = "C://cnqf/contract/word/"+ userid +"word.doc"; 146 | String pdfFile = "C://cnqf/contract/pdf/" + userid + "pdf.pdf"; 147 | System.out.println("开始转换"); 148 | // 开始时间 149 | long start = System.currentTimeMillis(); 150 | try { 151 | // 打开word 152 | app = new ActiveXComponent("Word.Application"); 153 | // 设置word不可见,很多博客下面这里都写了这一句话,其实是没有必要的,因为默认就是不可见的,如果设置可见就是会打开一个word文档,对于转化为pdf明显是没有必要的 154 | // app.setProperty("Visible", false); 155 | // 获得word中所有打开的文档 156 | Dispatch documents = app.getProperty("Documents").toDispatch(); 157 | System.out.println("打开文件: " + wordFile); 158 | // 打开文档 159 | Dispatch document = Dispatch.call(documents, "Open", wordFile, false, true).toDispatch(); 160 | // 如果文件存在的话,不会覆盖,会直接报错,所以我们需要判断文件是否存在 161 | File target = new File(pdfFile); 162 | if (target.exists()) { 163 | target.delete(); 164 | } 165 | System.out.println("另存为: " + pdfFile); 166 | // 另存为,将文档报错为pdf,其中word保存为pdf的格式宏的值是17 167 | Dispatch.call(document, "SaveAs", pdfFile, 17); 168 | // 关闭文档 169 | Dispatch.call(document, "Close", false); 170 | // 结束时间 171 | long end = System.currentTimeMillis(); 172 | System.out.println("转换成功,用时:" + (end - start) + "ms"); 173 | } catch (Exception e) { 174 | System.out.println("转换失败" + e.getMessage()); 175 | } finally { 176 | // 关闭office 177 | app.invoke("Quit", 0); 178 | } 179 | } 180 | } 181 | -------------------------------------------------------------------------------- /.idea/$CACHE_FILE$: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Abstraction issuesJava 10 | 11 | 12 | Android 13 | 14 | 15 | Assignment issuesJava 16 | 17 | 18 | Bitwise operation issuesJava 19 | 20 | 21 | Bitwise operation issuesJavaScript 22 | 23 | 24 | CDI (Contexts and Dependency Injection) 25 | 26 | 27 | Class metricsJava 28 | 29 | 30 | Class structureJava 31 | 32 | 33 | Cloning issuesJava 34 | 35 | 36 | Code maturityJava 37 | 38 | 39 | Code style issuesJava 40 | 41 | 42 | Code style issuesJavaScript 43 | 44 | 45 | CodePlugin DevKit 46 | 47 | 48 | CodeSpring CoreSpring 49 | 50 | 51 | Compiler issuesJava 52 | 53 | 54 | Control flow issuesJava 55 | 56 | 57 | Control flow issuesJavaScript 58 | 59 | 60 | CorrectnessLintAndroid 61 | 62 | 63 | DOM issuesJavaScript 64 | 65 | 66 | Data flowJava 67 | 68 | 69 | Data flowJavaScript 70 | 71 | 72 | Declaration redundancyJava 73 | 74 | 75 | ECMAScript 6 migration aidsJavaScript 76 | 77 | 78 | EncapsulationJava 79 | 80 | 81 | Error handlingJava 82 | 83 | 84 | Error handlingJavaScript 85 | 86 | 87 | FinalizationJava 88 | 89 | 90 | General 91 | 92 | 93 | GeneralJavaScript 94 | 95 | 96 | Google Web Toolkit 97 | 98 | 99 | Groovy 100 | 101 | 102 | ImportsJava 103 | 104 | 105 | Inheritance issuesJava 106 | 107 | 108 | InitializationJava 109 | 110 | 111 | InternationalizationJava 112 | 113 | 114 | J2ME issuesJava 115 | 116 | 117 | JBoss Seam 118 | 119 | 120 | JSP 121 | 122 | 123 | JUnitJava 124 | 125 | 126 | Java 127 | 128 | 129 | Java 5Java language level migration aidsJava 130 | 131 | 132 | Java 8Java language level migration aidsJava 133 | 134 | 135 | Java 9Java language level migration aidsJava 136 | 137 | 138 | Java EE 139 | 140 | 141 | Java interop issuesKotlin 142 | 143 | 144 | Java language level migration aidsJava 145 | 146 | 147 | JavaBeans issuesJava 148 | 149 | 150 | JavaFX 151 | 152 | 153 | JavaScript 154 | 155 | 156 | JavaScript function metricsJavaScript 157 | 158 | 159 | JavadocJava 160 | 161 | 162 | Kotlin 163 | 164 | 165 | LintAndroid 166 | 167 | 168 | LoggingJava 169 | 170 | 171 | MemoryJava 172 | 173 | 174 | Method metricsJava 175 | 176 | 177 | Naming conventionsJava 178 | 179 | 180 | Nullability problemsProbable bugsJava 181 | 182 | 183 | Numeric issuesJava 184 | 185 | 186 | PerformanceJava 187 | 188 | 189 | PerformanceLintAndroid 190 | 191 | 192 | Plugin DevKit 193 | 194 | 195 | PortabilityJava 196 | 197 | 198 | Potentially confusing code constructsJavaScript 199 | 200 | 201 | Probable bugsGroovy 202 | 203 | 204 | Probable bugsJava 205 | 206 | 207 | Probable bugsJavaScript 208 | 209 | 210 | Probable bugsKotlin 211 | 212 | 213 | SecurityJava 214 | 215 | 216 | SecurityLintAndroid 217 | 218 | 219 | Serialization issuesJava 220 | 221 | 222 | Spring 223 | 224 | 225 | Spring CoreSpring 226 | 227 | 228 | Spring DataSpring 229 | 230 | 231 | Threading issuesGroovy 232 | 233 | 234 | Threading issuesJava 235 | 236 | 237 | UsabilityLintAndroid 238 | 239 | 240 | Verbose or redundant code constructsJava 241 | 242 | 243 | VisibilityJava 244 | 245 | 246 | Web Services 247 | 248 | 249 | 250 | 251 | 252 | -------------------------------------------------------------------------------- /src/com/controller/UserListController.java: -------------------------------------------------------------------------------- 1 | package com.controller; 2 | 3 | import java.util.Arrays; 4 | import java.util.UUID; 5 | 6 | import javax.annotation.Resource; 7 | import javax.servlet.http.HttpServletRequest; 8 | import javax.servlet.http.HttpServletResponse; 9 | import javax.servlet.http.HttpSession; 10 | 11 | import org.springframework.stereotype.Controller; 12 | import org.springframework.web.bind.annotation.RequestMapping; 13 | import org.springframework.web.bind.annotation.ResponseBody; 14 | import org.springframework.web.servlet.ModelAndView; 15 | 16 | import com.code.Code; 17 | import com.currency.Koken; 18 | import com.javabean.adminlist; 19 | import com.javabean.checkoutapplication; 20 | import com.javabean.headportraitimg; 21 | import com.javabean.userlist; 22 | import com.service.AdminListService; 23 | import com.service.CheckoutapplicationService; 24 | import com.service.HeadPortraitImgService; 25 | import com.service.UserlistService; 26 | 27 | /** 28 | * 用户控制器 29 | * 30 | * @author Administrator 31 | * 32 | */ 33 | @Controller 34 | @RequestMapping("/userlistmvc") 35 | public class UserListController { 36 | 37 | private static final long serialVersionUID = -884689940866074733L; 38 | 39 | @Resource 40 | private UserlistService userlistService; 41 | 42 | @Resource 43 | private AdminListService adminListService; 44 | 45 | @Resource 46 | private HeadPortraitImgService headPortraitImgService; 47 | 48 | @Resource 49 | private CheckoutapplicationService checkoutapplicationService; 50 | 51 | /** 52 | * 登录 53 | */ 54 | @RequestMapping("/userpwd") 55 | public String userpwd(String username, String pwd, String[] identity, HttpServletRequest request) { 56 | HttpSession session = request.getSession(); 57 | if (username.equals("") || pwd.equals("")) { 58 | request.setAttribute("erorr", "输入账号密码不能为空!"); 59 | return "login"; 60 | } 61 | 62 | String tempstr = null; 63 | 64 | try { 65 | if (identity[0].equals("user")) { 66 | userlist temp = new userlist(); 67 | temp.setUsercall(username); 68 | temp.setUserpwd(pwd); 69 | userlist userlist = userlistService.queryAllUserPwd(temp); 70 | try { 71 | tempstr = userlist.getUsercall(); 72 | if (tempstr != null) { 73 | session.setAttribute("user", tempstr); 74 | headportraitimg headportraitimg = headPortraitImgService.selectheadportrait(tempstr); 75 | if (headportraitimg.getHeadportraitimgaddress() != null) { 76 | session.setAttribute("headportraitimg", headportraitimg.getHeadportraitimgaddress()); 77 | } 78 | return "official"; 79 | } 80 | } catch (NullPointerException e) { 81 | if (tempstr == null) { 82 | request.setAttribute("erorr", "输入账号密码有误!"); 83 | return "login"; 84 | } else { 85 | return "official"; 86 | } 87 | } 88 | } 89 | if (identity[0].equals("admin")) { 90 | adminlist temp = new adminlist(); 91 | temp.setAdminname(username); 92 | temp.setAdminpwd(pwd); 93 | adminlist adminlist = adminListService.findAllAdminPwd(temp); 94 | try { 95 | tempstr = adminlist.getAdminname(); 96 | if (tempstr != null) { 97 | session.setAttribute("admin", tempstr); 98 | return "BackgroundHome"; 99 | } 100 | } catch (NullPointerException e) { 101 | request.setAttribute("erorr", "输入账号密码有误!"); 102 | return "login"; 103 | } 104 | } 105 | } catch (NullPointerException e) { 106 | request.setAttribute("erorr", "选择登录方式!"); 107 | e.printStackTrace(); 108 | return "login"; 109 | } 110 | 111 | return "login"; 112 | } 113 | 114 | /** 115 | * 注册 116 | */ 117 | @RequestMapping("/register") 118 | public String register(String usercall, String userpwd, String userphone, HttpServletRequest request) { 119 | if (usercall.equals("") || userpwd.equals("") || userphone.equals("")) { 120 | request.setAttribute("erorr", "输入账号密码不能为空!"); 121 | return "register"; 122 | } 123 | userlist user = new userlist(); 124 | user.setUsercall(usercall); 125 | user.setUserphone(userphone); 126 | user.setUserpwd(userpwd); 127 | userlistService.insert(user); 128 | headportraitimg userimg = new headportraitimg(); 129 | userimg.setHeadportraitimgusername(usercall); 130 | headPortraitImgService.insertuserimg(userimg); 131 | return "login"; 132 | } 133 | 134 | /** 135 | * 获取手机验证码 136 | **/ 137 | @RequestMapping("/getcode") 138 | public void getcode(String userphone, HttpServletResponse response, HttpServletRequest request) { 139 | response.setCharacterEncoding("UTF-8"); 140 | try { 141 | HttpSession session = request.getSession(); 142 | String code = "123456"; 143 | // String code = Code.getNum(userphone); 144 | System.out.println(code); 145 | session.setAttribute("code", code); 146 | 147 | } catch (Exception e) { 148 | // TODO Auto-generated catch block 149 | e.printStackTrace(); 150 | } 151 | 152 | } 153 | 154 | /** 155 | * 判断验证码输入后登陆 156 | **/ 157 | @RequestMapping("/phonecod") 158 | public String phonecod(String userphone, String code, HttpServletRequest request) { 159 | HttpSession session = request.getSession(); 160 | if (userphone.equals("") || code.equals("")) { 161 | request.setAttribute("erorr", "手机号或者验证码为空!"); 162 | return "login"; 163 | } 164 | System.out.println(code); 165 | if (code.equals(session.getAttribute("code"))) { 166 | userlist user = userlistService.selectUserPhone(userphone); 167 | if (user != null) { 168 | String tempstr = null; 169 | userlist userlist = userlistService.selectUserPhone(userphone); 170 | tempstr = userlist.getUsercall(); 171 | if (tempstr != null) { 172 | session.setAttribute("user", tempstr); 173 | headportraitimg headportraitimg = headPortraitImgService.selectheadportrait(tempstr); 174 | if (headportraitimg.getHeadportraitimgaddress() != null) { 175 | session.setAttribute("headportraitimg", headportraitimg.getHeadportraitimgaddress()); 176 | } 177 | return "official"; 178 | } 179 | } else { 180 | request.setAttribute("erorr", "该手机号未注册!"); 181 | return "login"; 182 | } 183 | } else { 184 | request.setAttribute("erorr", "验证码错误!"); 185 | return "login"; 186 | } 187 | return "login"; 188 | } 189 | 190 | /** 191 | * 修改密码 192 | */ 193 | @RequestMapping("/updatepwd") 194 | public String updatepwd(String code, String userphone, String userpwd, HttpServletRequest request) { 195 | if (code.equals("") || userphone.equals("") || userpwd.equals("")) { 196 | request.setAttribute("erorr", "手机号,验证码,新密码不能为空!"); 197 | return "updatepwd"; 198 | } 199 | HttpSession session = request.getSession(); 200 | if (code.equals(session.getAttribute("code"))) { 201 | userlist userlist = userlistService.selectUserPhone(userphone); 202 | userlist.setUserpwd(userpwd); 203 | userlistService.updatepwd(userlist); 204 | return "login"; 205 | } 206 | return userpwd; 207 | } 208 | 209 | /** 210 | * 注销 211 | */ 212 | @RequestMapping("/cancellation") 213 | public String cancellation(HttpServletRequest request) { 214 | HttpSession session = request.getSession(); 215 | session.removeAttribute("user"); 216 | System.out.println("注销成功"); 217 | return "official"; 218 | } 219 | 220 | /** 221 | * 申请看房 222 | */ 223 | @RequestMapping("/apply") 224 | @ResponseBody 225 | public ModelAndView apply(HttpSession session, HttpServletRequest request, String housemoney, String housecall, 226 | String houseaddress,String housesize) { 227 | ModelAndView mav = new ModelAndView("official"); 228 | //令牌验证 229 | if(!new Koken().kokenid(request, session)) { 230 | return mav; 231 | } 232 | mav.addObject("news", "official"); 233 | if ((String) session.getAttribute("user") == null) { 234 | mav.addObject("apply", "请先登录!"); 235 | return mav; 236 | } 237 | // 查询所有数据 238 | userlist user = userlistService.selectUserCall((String) session.getAttribute("user")); 239 | if (user.getUsername() == null) {// 判断真实姓名是否为空 240 | mav.addObject("apply", "请绑定真实姓名后再租赁房屋!"); 241 | return mav; 242 | } else { 243 | checkoutapplication coa = new checkoutapplication(); 244 | coa.setCoausername(user.getUsername()); 245 | coa.setCoauserid(user.getUserid()); 246 | coa.setCoauserphone(user.getUserphone()); 247 | coa.setCoahouseid(housecall); 248 | coa.setCoahouseaddress(houseaddress); 249 | coa.setCoahouseprice(Double.parseDouble(housemoney)); 250 | coa.setCoahousesize(Double.parseDouble(housesize)); 251 | coa.setCoastate("看房申请中"); 252 | String temp=checkoutapplicationService.insertApply(coa); 253 | mav.addObject("apply", temp); 254 | } 255 | return mav; 256 | } 257 | 258 | } 259 | -------------------------------------------------------------------------------- /.idea/workspace.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 15 | 16 | 22 | 23 | 30 | 35 | 36 | 37 | 38 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 131 | 132 | 133 |