Java固定资产管理系统源代码
- 格式:docx
- 大小:25.14 KB
- 文档页数:97
固定资产管理系统的设计与实现固定资产是企业中非常重要的一项财务资产,它包括了企业所有不易流动的资产,如土地、厂房、机械设备、交通工具等等。
随着现代企业规模的不断扩大,固定资产也日益增加,这给资产管理带来了巨大的挑战。
为了对企业的固定资产进行更好、更有效的管理,开发一种高效的固定资产管理系统势在必行。
下面我们来学习如何设计和实现这样一种系统。
一、需求分析在设计一款固定资产管理系统之前,我们需要首先进行需求分析。
从实际需求出发,确定系统所需的功能、流程和接口等。
根据我们对固定资产管理的经验,可以在需求分析时将相关功能划分如下:1. 资产信息管理:包括资产种类、编号、状态、购置日期、购置价格、使用情况、维修记录等信息的录入、查询、修改和删除等功能。
2. 资产分类管理:针对不同的固定资产分类进行管理,如土地、房屋、机械设备等,同时还要考虑资产的规格、品牌、型号等信息。
3. 报废资产处理管理:管理和处理已经达到使用年限或已经报废的固定资产,包括资产的出售、报废、转移等。
4. 维修保养管理:对固定资产进行维护、检修和保养,同时记录维护情况及花费等信息。
5. 报表分析:通过固定资产的各项统计数据,为企业管理决策提供数据支持。
在分析了以上的需求后,我们可以继续设计和实现属于我们自己的固定资产管理系统。
二、系统设计根据需求分析,我们可以对固定资产管理系统进行设计,设计过程需要确定系统所需的技术框架、设计思路和实现方法等。
1.技术框架对于固定资产管理系统而言,我们可以使用Java语言进行开发,并采用的技术框架是Spring、Hibernate、Struts2和Eclipse等。
在开发时,我们可以运用Spring框架来实现业务逻辑进行管理,且可以在不同的层级中充分利用Spring提供的注入式依赖管理和AOP处理功能。
再利用Hibernate框架完成数据的持久化和维护,使用Struts2来实现页面的请求和响应管理,并用Eclipse进行代码开发和调试。
一、项目背景介绍1.1 仓库管理系统的重要性仓库管理系统是一种对仓库内物品进行全面管理和监控的信息系统。
在现代物流管理中,仓库管理系统扮演着至关重要的角色,可以提高仓库的利用率、降低存货成本、提高物流效率,为企业节省大量人力和物力资源,是企业管理中不可或缺的一部分。
1.2 项目意义本课程设计拟设计并实现一套基于Java语言的仓库管理系统,旨在通过应用软件技术和信息管理技术,实现对进销存等多类业务流程的自动化管理,并在实际操作中验证其运行效果和实用性,为学生提供一种将所学知识应用于实践的机会。
二、系统功能需求2.1 基本功能1) 系统登入:要求用户输入用户名和密码进行登入验证;2) 信息录入:包括商品信息、入库信息、出库信息等的录入;3) 信息查询:可以根据商品编号、名称、类别等条件查询商品信息;4) 库存管理:可以实时查看库存状况,并进行库存的盘点与调剂;5) 报表输出:可以输出商品进销存报表,方便管理人员进行决策;6) 权限管理:不同用户具有不同的权限,管理员具有对系统进行设置的权限。
2.2 进一步功能1) 供应商管理:可以录入供应商信息,并进行供应商的评价和选择;2) 客户管理:可以录入客户信息,并对客户进行分类管理;3) 交易管理:支持交易的生成、记录和统计。
三、技术选型和开发环境3.1 技术选型本系统采用Java语言作为主要开发语言,使用MySQL作为数据库,前端采用Swing技术进行界面设计,后端采用JDBC进行数据传输和交互。
3.2 开发工具1) 开发环境:Eclipse2) 数据库工具:Navicat3) 版本管理工具:Git4) 项目管理工具:Maven四、系统设计4.1 系统架构设计本系统采用MVC(Model-View-Controller)架构,将业务逻辑、数据表示和用户界面分离,使得系统更加易于维护和升级。
4.2 数据库设计1) 商品表:包括商品编号、名称、类别、进价、售价、库存等字段;2) 入库表:包括入库单号、商品编号、数量、日期等字段;3) 出库表:包括出库单号、商品编号、数量、日期等字段;4) 用户表:包括用户名、密码、权限等字段。
任务书任务名称:基于Java的物业管理系统开发任务发布人:XXX 公司任务接受人:XXX 开发团队任务时间:2023年1月1日-2023年6月30日任务目标:1.开发一套基于Java的物业管理系统,实现对小区、楼宇、房屋、业主等信息的管理和维护。
2.系统应具备用户管理、数据查询、费用管理、报修管理、公告发布等基本功能,并实现对各项功能的权限控制。
3.系统应具备良好的用户交互界面和操作体验,保证系统的稳定性和可靠性。
4.系统应具备一定的扩展性和可维护性,方便后续的功能升级和维护工作。
任务内容:1.需求分析和功能设计1.1.对物业管理系统的需求进行详细分析,确定系统的功能模块和技术方案。
1.2.细化功能设计,包括用户管理、数据查询、费用管理、报修管理、公告发布等模块的详细功能和交互流程。
2.技术选型和框架搭建2.1.根据需求和功能设计,确定系统所需的技术框架和组件,包括数据库、后端开发框架、前端界面框架等。
2.2.搭建系统的基本框架,包括数据库设计、后端接口设计、前端界面设计等。
3.功能开发与测试3.1.根据功能设计和技术框架,开发系统的各个功能模块。
3.2.进行功能模块的单元测试和集成测试,确保功能的正常运行和稳定性。
4.用户交互界面设计与优化4.1.设计用户交互界面,确保界面简洁、清晰、易用。
4.2.对用户交互界面进行优化,提升用户体验和操作效率。
5.系统整体测试5.1.对整个系统进行全面测试,包括功能测试、性能测试、安全测试等。
5.2.发现并解决系统中存在的问题和bug,确保系统的稳定性和可靠性。
6.系统上线与运营6.1.将系统部署上线,确保系统的稳定运行。
6.2.进行系统的运营和维护工作,解决用户反馈的问题,定期更新和优化系统。
任务验收标准:1.系统具备完整的功能模块,包括用户管理、数据查询、费用管理、报修管理、公告发布等。
2.系统的界面简洁清晰,用户操作流畅,用户体验良好。
3.系统稳定性和可靠性得到验证,能够满足大量用户同时上线使用的需求。
优秀java开源项目代码
有许多优秀的Java开源项目可供学习。
以下是一些示例:
1.Spring Framework:Spring是一个开源的Java平台,为开发者提供了
全面的编程和配置模型,以及一个轻量级的无侵入式框架。
它是一个为Java应用程序开发提供全面支持的框架,尤其在开发企业级应用程序方面表现突出。
2.Hibernate:Hibernate是一个对象关系映射(ORM)框架,它允许Java程
序员将对象模型映射到关系数据库中。
Hibernate提供了一种方式,使你可以直接将对象之间的相互作用映射到数据库的CRUD操作。
3.Apache Commons:Apache Commons是一组Java工具库,提供了许
多实用的功能,包括字符串操作、文件操作、数值计算等。
这个项目为Java开发者提供了许多易于使用且高效的工具。
4.Guava:Guava是Google的Java核心库,提供了很多有用的工具类和实
用程序,如缓存、并发库、原始类型支持、集合操作、字符串处理、I/O等。
flix Eureka:Eureka是一个服务发现组件,用于定位运行在AWS云
或其他云平台上的中间层服务,而不需要服务消费者知道服务提供者的实例ID。
flix Hystrix:Hystrix是一个容错管理工具,旨在隔离访问远程系统、
服务和第三方库的点,以防止级联故障。
flix Ribbon:Ribbon是一个客户端负载均衡器,有助于在云端实现
微服务之间的通信。
以上都是优秀的Java开源项目,你可以从中学习到很多知识和技巧。
固定资产管理 php源码
固定资产管理是企业管理中非常重要的一项工作,它涉及到企业资产的购置、使用、维护和报废等方方面面。
为了更加高效地管理固定资产,许多企业选择使用计算机软件来进行固定资产管理。
而PHP作为一种流行的服务器端脚本语言,可以用来开发各种类型的Web应用程序,包括固定资产管理系统。
在固定资产管理的PHP源码中,通常会包括以下功能模块:
1. 资产登记,通过这个模块,用户可以录入新购置的固定资产信息,包括资产名称、型号、购置日期、购置金额等。
2. 资产查询,用户可以通过这个模块来查询已经登记的固定资产信息,可以根据资产名称、购置日期等条件进行查询。
3. 资产领用和归还,这个模块用来记录固定资产的领用和归还情况,包括领用人员、领用日期、归还日期等信息。
4. 资产维护和维修,记录固定资产的维护和维修情况,包括维护人员、维护日期、维修费用等信息。
5. 资产报废,当固定资产达到报废标准时,可以通过这个模块来进行资产报废处理,包括报废日期、报废原因等信息。
在开发固定资产管理系统的PHP源码时,需要考虑到系统的安全性、稳定性和扩展性。
同时,还需要考虑到用户界面的友好性和操作的便捷性,以便用户能够更加方便地进行固定资产管理工作。
总的来说,固定资产管理的PHP源码是一个非常实用的工具,它可以帮助企业更加高效地管理固定资产,提高资产的利用率,降低维护成本,是企业管理中不可或缺的一部分。
固定资产管理系统软件开发方案一、背景和目标:随着企业规模的扩大,企业的固定资产数量也在不断增长。
对固定资产进行有效的管理和监控,能够提高资产的使用效率,降低管理成本,并为企业的发展提供重要的支持。
因此,研发一款固定资产管理系统软件具有重要意义。
本固定资产管理系统软件开发方案旨在设计和实现一款功能完善、操作简便、安全稳定的财务管理系统,以实现对企业固定资产的全面管理,包括固定资产的入库、出库、折旧、维修与保养等。
二、系统需求:1.入库管理:实现对固定资产的入库登记、验收和档案管理等功能。
包括固定资产的基本信息录入、资产的入库流程审批、入库单的打印等。
2.出库管理:实现对固定资产的出库审批、归还管理等功能。
包括对固定资产借用申请的审批、出库单的打印、出库资产的归还登记等。
3.折旧管理:对固定资产进行折旧计算和折旧费用的核算。
包括折旧方法的选择、折旧核算的自动化处理、折旧报告的生成等。
4.维修与保养管理:实现对固定资产的维修保养计划和操作的管理。
包括对维修保养计划的制定和执行的跟踪,维修保养记录的保存和查询等。
5.报表分析:生成固定资产报表,包括入库报表、出库报表、折旧报表、维修保养报表等,以便企业管理层进行决策分析和财务报告。
6.数据安全性:系统数据的安全性是重要的考虑因素,需加入权限管理、备份恢复等功能,确保数据的完整性和保密性。
三、技术路线:1.系统架构:采用B/S架构,基于浏览器的操作界面,采用前后端分离技术,提高系统的易用性和性能。
2. 开发语言和工具:前端使用HTML、CSS、JavaScript等技术进行页面开发;后端使用Java开发,采用Spring框架和MySQL数据库。
同时,可以考虑使用Vue.js等现代化前端框架提升用户体验。
3.数据库设计:根据系统需求,设计相应的数据库表结构,并进行优化,以提高系统的响应速度和稳定性。
4.安全措施:引入权限管理模块,设置不同角色对系统的访问权限;定期进行数据备份,并提供恢复功能,保障数据的安全性和完整性。
#include<string.h>void menu(){int n,w1;do{printf("\t\t *** choose function ****\n\n");printf("\t\t *** 1 Enter new data ****\n\n");printf("\t\t *** 2 Modify data ****\n\n");printf("\t\t *** 3 Search by pro.date and name\n\n");printf("\t\t *** 4 Browse data ****\n\n");printf("\t\t *** 5 add data ****\n\n");printf("\t\t *** 6 Exit ****\n\n");printf("Choose your number(1-6):[ ]\b\b");scanf("%d",&n);if(n<1||n>6)w1=1;else w1=0;}while(w1==1);switch(n){case 1:enter();break;case 2:modify();break;case 3:search();break;case 4:browse();break;case 5:add();break;case 6:exit(0);}}main(){menu();}#define N 100struct Product{char num[100];char name[15];char size[4];char time[10];char amount[20];}Product[N];# include <stdio.h>enter(){int i,n;printf("How many Products(0-%d)?:",N-1);scanf("%d",&n);printf("\n Enter data now\n\n");for(i=0;i<n;i++){printf("\n Input %dth product record.\n",i+1); input(i);}if(i!=0)save(n);printf_back();}browse(){int i,j,n;n=load();printf_face();for(i=0;i<n;i++){if((i!=0)&&(i%10==0)){printf("\n\nPass any key to continue ....");getch();puts("\n\n");}printf_one(i) ;}printf("\tThere are %d record.\n",n);printf("\nPass any key to back ...");getch();menu();}add(){int i,n,m,k;FILE*fp;n=load();printf("How many Products are you want to add(0-%d)?:",N-1-n);scanf("%d",&m);k=m+n;for(i=n;i<k;i++){printf("\nInput %dth Product record.\n",i-n+1 );input(i);}if((fp=fopen("Pro.txt","ab"))==NULL){printf("cannot open file\n");}for(i=n;i<k;i++)if(fwrite(&Product[i],sizeof(struct Product),1,fp)!=1)printf("file write error\n");fclose(fp);printf_back();}search(){int i,n,k,w1=1,w2,w3,w4,m,a;struct Product p;n=load();do{printf("\n\nWhich way do you want to choose? \n\t1).By time 2).By name [ ]\b\b");scanf("%d",&m);switch(m){case 1:do{ k=-1;printf("\n\nEnter time that you want to search! TIME.");scanf("%s",p.time);printf_face();for(i=0;i<n;i++)if(strcmp(p.time,Product[i].time)==0){ k=i;printf_one(k);break;}if(k==-1){ printf("\n\nNO exist!please");printf("\n\nAre you again?\n\t1).again 2).NO and back [ ]\b\b");scanf("%d",&w1);if(w1==2)printf_back();}}while(k==-1&&w1==1);break;case 2:do{k=-1;printf("\n\nEnter name that you want to search! name.");scanf("%s",);printf_face();for(i=0;i<n;i++)if(strcmp(,Product[i].name)==0){k=i;printf_one(k);break;}if(k==-1){printf("\n\nNO exist!please");printf("\n\nAre you again?\n\t1).again 2).NO and back [ ]\b\b");scanf("%d",&w1);if(w1==2)printf_back();}}while(k==-1&&w1==1);break;}w4=0;w3=0;if(k!=-1){printf("\n\nWhat do you want to do?\n\t 1).Search 2).Modify 3).Delete 4).Back menu [ ]\b\b");scanf("%d",&w2);switch(w2){case 2:w3=modify_data(k,n);break;case 3:{printf("\nAre you sure?\n\t 1).Sure 2).No and back [ ]\b\b");scanf("%d",&w4);if(w4==1)for(a=k;a<n;a++){strcpy(Product[a].num,Product[a+1].num);strcpy(Product[a].name,Product[a+1].name);strcpy(Product[a].size,Product[a+1].size);strcpy(Product[a].time,Product[a+1].time);strcpy(Product[a].amount,Product[a+1].amount);}break;}}if(w3==1||w4==1){save(n);printf("\n\nSuccessful.^_^.");printf("\n\nWhant do you want to do? \n\t 1).Search another 2).Back [ ]\b\b" );scanf("%d",&w2);}}}while(w2==1);menu();}modify(){struct Product p;FILE *fp;int i,n,k,w0=1,w1,w2=0;n=load();do{k=-1;printf_face();for(i=0;i<n;i++){if((i!=0)&&(i%10==0)){printf("\n\nRemember NO.which needed modify.pass any key to contiune ...");getch();puts("\n\n");}printf_one(i);}do{printf("\n\nEnter NO.that you want to modify! NO.:");scanf("%s",p.num);for(i=0;i<n;i++)if(strcmp(p.num,Product[i].num)==0){k=i;p=Product[i];}if(k==-1)printf("\n\nNO exist!please again");}while(k==-1);printf_face();printf_one(k);w1=modify_data(k,n);if(w1==1){printf("\nSuccessful ^_^.\n\nAre you modify another ?\n\n\t 1).Yes 2).Back with save\t[ ]\b\b");scanf("%d",&w0);w2=1;}else{w0=0;if(w2==1)Product[k]=p;}if(w0!=1&&w2==1)save(n);}while(w0==1);menu();}save(int n){FILE *fp;int i;if((fp=fopen("Pro.txt","wb"))==NULL){printf("\nCannot open file\n");return NULL;}for(i=0;i<n;i++)if(Product[i].time!=0)if(fwrite(&Product[i],sizeof(struct Product),1,fp)!=1) printf("file write error\n");fclose(fp);}load(){FILE *fp;int i;if((fp=fopen("Pro.txt","rb"))==NULL){printf("\nCannot open file\n");return NULL;}for(i=0;!feof(fp);i++)fread(&Product[i],sizeof(struct Product),1,fp);fclose(fp);return(i-1);}input(int i){no_input(i,i);printf("num:");scanf("%s",Product[i].num);printf("name:");scanf("%s", Product[i].name) ;printf("size:");scanf("%s",Product[i].size);printf("time:");scanf("%s",Product[i].time);printf("amount:");scanf("%s",Product[i].amount);}modify_data(int i){int c,w1;do{puts("\nmodify by=>\n\n 1).num 2).name 3).size 4).time 5).amount ");printf("Which you needed?:[ ]\b\b");scanf("%d",&c);if(c>5||c<1){puts("\nChoice error!Please again!");getchar();}}while(c>5||c<1);do{switch(c){case 1:printf("num:");scanf("%s",Product[i].num);break;case 2:printf("name:");scanf("%s",Product[i].name);break;case 3:printf("size:");scanf("%s",Product[i].size);break;case 4:printf("time:");scanf("%s",Product[i].time);break;case 5:printf("amount:");scanf("%s",Product[i].amount);break;}puts("\nNow:\n");printf_face();printf_one(i);printf("\nAre you sure?\n\n\t 1).Sure 2).No and remodify 3).Back without save in this time [ ]\b\b");scanf("%d",&w1);}while(w1==2);return(w1);}no_input(int i,int n){int j,k,w1;do{w1=0;printf("NO.:");scanf("%s",Product[i].num);for(j=0;Product[i].num[j]!='\0';j++)if(Product[i].num[j]>'9'){puts("Input error!Only be made up of(0-9).Please reinput!\n");w1=1;break;}if(w1!=1)for(k=0;k<n;k++)if(k!=i&&strcmp(Product[k].num,Product[i].num)==0){puts("This record is exist.please reinput!\n");}}while(w1==1);}printf_face(){printf("\nnum name size time amount \n");}printf_one(int i){int j;printf("%7s%7s%7s%10s%12s\n",Product[i].num,Product[i].name,Product[i].size,Product[ i].time,Product[i].amount);}printf_back(){int j,w;printf("\n\n\tSuccessful.^_^\n\n");printf("What do you want you to do?\n\n\t1).Browse all now\t2).Back: [ ]\b\b");scanf("%d",&w);if(w==1)browse();else menu();}。
Java银行账户管理系统代码简介银行账户管理系统是一个用于管理银行客户账户的软件系统。
该系统可以实现客户开户、存款、取款、转账等基本功能,同时提供了查询账户余额、查询交易记录等附加功能,便于客户管理自己的资金。
功能模块客户管理模块这个模块包括客户信息的增删改查功能。
系统可以记录客户的姓名、身份证号、手机号等基本信息。
账户管理模块这个模块包括账户的开户、销户、存款、取款、转账等功能。
代码实现客户类public class Customer {private String name;private String idCard;private String phoneNumber;// 构造方法public Customer(String name, String idCard, String phoneNumber) { = name;this.idCard = idCard;this.phoneNumber = phoneNumber;}// getter和setter方法public String getName() {return name;}public void setName(String name) { = name;}public String getIdCard() {return idCard;}public void setIdCard(String idCard) {this.idCard = idCard;}public String getPhoneNumber() {return phoneNumber;}public void setPhoneNumber(String phoneNumber) {this.phoneNumber = phoneNumber;}}账户类```java public class Account { private String accountNumber; private double balance; private Customer customer;// 构造方法public Account(String accountNumber, Customer customer) {this.accountNumber = accountNumber;this.customer = customer;}// 存款public void deposit(double amount) {balance += amount;}// 取款public void withdraw(double amount) {if (balance >= amount) {balance -= amount;} else {System.out.println(\。
目录摘要 (I)Abstract................................................................................................................ I I 引言. (1)1相关技术 (3)1.1 Vue框架 (3)1.2 Spring Boot框架 (3)1.3 ECharts (3)1.4 JQuery技术 (3)1.5 本章小结 (4)2系统分析 (5)2.1需求分析 (5)2.2非功能需求 (6)2.3本章小结 (6)3系统设计 (7)3.1系统总体设计 (7)3.1.1系统体系结构 (7)3.1.2系统目录结构 (7)3.1.3系统功能结构 (7)3.2系统详细设计 (8)3.2.1 系统功能设计 (8)3.2.2数据库设计 (9)3.3本章小结 (12)4系统实现 (13)4.1开发环境 (13)4.2开发规范 (13)4.3数据库实现 (13)4.4 Spring Boot项目搭建 (14)4.5功能实现 (14)5系统测试 (19)5.1测试计划 (19)5.2用例测试 (19)5.3压力测试 (19)5.4本章小结 (20)结论 (21)摘要随着不断的扩大企业的规模,一开始用手工去管理固定资产的方法已经不能适用于现在的企业发展现状,也无法满足企业的许多要求,比如管理的快捷性和管理的准确性。
然而计算机信息管理技术的迅猛成长就能恰当的解决这个问题,同时,计算机技术能够与现代化的管理技术互相的协调与配合,做完企业每日的固定资产管理工作就会更加的精准与快速!这样企业就能用最少的人员去完成较多的工作,工作的效率与完成工作的质量也有了大幅度的提高!在这样有应用需求的强行推动下,近期中国自主研发的技术有了很大的提升,比如说ERP软件技术,它的功能齐全,满足于多数的大、中型企业的发展需求。
////////////////////////////////////////////////////////////////////////////// ///////////////////////用户登录////////////////////////////////////////////////////////////////////////////// ///////////////////////package com.newer.property;import java.awt.GridLayout;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import java.sql.*;import java.sql.Statement;import java.sql.ResultSet;import javax.swing.JButton;import javax.swing.JLabel;import javax.swing.JTextField;import javax.swing.JPasswordField;import javax.swing.JPanel;import javax.swing.JFrame;public class user_land extends JFrame implements ActionListener{ static Connection conn=null;static Statement stat=null;static ResultSet rs=null;static String url="jdbc:sqlserver://127.0.0.1:1433;DatabaseName=_Property";static String user="sa";static String password="";JPanel p1,p2,p3,p4,p5;JLabel lbl1,lbl2,lbl3,lbl4;JTextField txt_name;JPasswordField txt_pwd;JButton btn1,btn2,btn3;static{try{Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");}catch(Exception e){System.out.println("加载驱动失败");e.printStackTrace();}}public user_land(){this.setTitle("固定资产及设备用户登录");p1=new JPanel();p2=new JPanel();p3=new JPanel();p4=new JPanel();p5=new JPanel();lbl1=new JLabel("欢迎登录");lbl2=new JLabel("用户名:");lbl3=new JLabel("密码:");lbl4=new JLabel();txt_name=new JTextField(10);txt_pwd=new JPasswordField(10);btn1=new JButton("登录");btn2=new JButton("清空");btn3=new JButton("退出");p1.add(lbl1);p2.add(lbl2);p2.add(txt_name);p3.add(lbl3);p3.add(txt_pwd);p4.add(btn1);p4.add(btn2);p4.add(btn3);p5.add(lbl4);this.setLayout(new GridLayout(5,1)); this.add(p1);this.add(p2);this.add(p3);this.add(p4);this.add(p5);this.setBounds(400, 300, 400, 300);this.setDefaultCloseOperation(EXIT_ON_CLOSE);this.setVisible(true);//添加按钮登录事件btn1.addActionListener(new ActionListener(){public void actionPerformed(ActionEvent e) {if((txt_name.getText().equals("")==true)&&(txt_pwd.getText().equals("")==false ))lbl4.setText("登录失败,用户名不能为空");if((txt_name.getText().equals("")==false)&&(txt_pwd.getText().equals("")==true ))lbl4.setText("登录失败,密码不能为空");if((txt_name.getText().equals("")==true)&&(txt_pwd.getText().equals("")==true) )lbl4.setText("登录失败,用户名/密码不能为空");if(is_Property()){new Sys_interface().show();}elseif((txt_name.getText().equals("")==false)&&(txt_pwd.getText().equals("")==fals e))lbl4.setText("登录失败,用户名/密码错误");}});btn1.addActionListener(this);//清空用户名和密码btn2.addActionListener(new ActionListener(){public void actionPerformed(ActionEvent e) {txt_name.setText(null);txt_pwd.setText(null);lbl4.setText(null);}});//退出btn3.addActionListener(new ActionListener(){public void actionPerformed(ActionEvent e) { System.exit(0);}});}protected void user_land(Object setVisible) {// TODO Auto-generated method stub}public boolean is_Property(){try{conn=DriverManager.getConnection(url, user, password);//System.out.println("连接成功");stat=conn.createStatement();String sql="select * from Admin_Info";rs=stat.executeQuery(sql);while(rs.next()){//System.out.println(rs.getString("A_name")+"\t"+rs.getString("A_pwd"));String name=txt_name.getText();String pwd=txt_pwd.getText();if(name.equals(rs.getString("A_name")) &&pwd.equals(rs.getString("A_pwd"))){//System.out.println("登录成功!!");return true;}}}catch(SQLException e){System.out.println("连接失败!!!");e.printStackTrace();}//关闭数据库finally{try{if(rs!=null){rs.close();}if(stat!=null){stat.close();}if(conn!=null){conn.close();}}catch(Exception e2){System.out.println("关闭失败");e2.printStackTrace();}}return false;}public static void main(String[] args) { new user_land();}public void actionPerformed(ActionEvent e) {//System.exit(0);this.setVisible(false);}}////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////主界面////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////package com.newer.property;import java.awt.BorderLayout;import java.awt.Color;import java.awt.Dialog;import java.awt.FlowLayout;import java.awt.Font;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import javax.swing.JFrame;import javax.swing.JLabel;import javax.swing.JMenuBar;import javax.swing.JMenuItem;import javax.swing.JMenu;import javax.swing.JPanel;import javax.swing.JTextArea;import javax.swing.JTextField;public class Sys_interface extends JFrame implements ActionListener { JPanel p=null;JMenuItem jmi_1,jmi_2,jmi_3,jmi_4,jmi_5,jmi_6,jmi_7,jmi_8,jmi_9,jmi_10;JMenuBar jmb=null;JMenu jm_1=null,jm_2=null,jm_3=null,jm_4=null;JLabel text;public Sys_interface(){this.setTitle("固定资产及设备管理系统");text=new JLabel(" 欢迎进入固定资产及设备管理系统"); text.setFont(new Font("宋体",1,28));text.setForeground(Color.blue);p=new JPanel();jmb=new JMenuBar();jm_1=new JMenu("系统功能");jm_2=new JMenu("资产管理");jm_3=new JMenu("系统查询");jm_4=new JMenu("帮助");jmi_1=new JMenuItem("用户登录");jmi_2=new JMenuItem("注销用户");jmi_3=new JMenuItem("用户添加");jmi_4=new JMenuItem("退出系统");jmi_5=new JMenuItem("资产借出管理");jmi_6=new JMenuItem("资产信息管理");jmi_7=new JMenuItem("资产信息查询");jmi_8=new JMenuItem("资产借出查询"); jmi_9=new JMenuItem("资产归还查询"); jmi_10=new JMenuItem("关于");jm_1.add(jmi_1);jm_1.add(jmi_2);jm_1.add(jmi_3);jm_1.add(jmi_4);jm_2.add(jmi_5);jm_2.add(jmi_6);jm_3.add(jmi_7);jm_3.add(jmi_8);jm_3.add(jmi_9);jm_4.add(jmi_10);jmb.add(jm_1);jmb.add(jm_2);jmb.add(jm_3);jmb.add(jm_4);add(text,BorderLayout.CENTER);this.setJMenuBar(jmb);//this.setLayout(new BorderLayout());//this.add(p,BorderLayout.NORTH);jmi_1.addActionListener(new ActionListener(){public void actionPerformed(ActionEvent e) {new user_land().show();}});jmi_2.addActionListener(this);jmi_2.addActionListener(new ActionListener() { @Overridepublic void actionPerformed(ActionEvent arg0) {new user_land().show();}});jmi_3.addActionListener(new ActionListener(){public void actionPerformed(ActionEvent e) {new Pass_word().show();}});jmi_4.addActionListener(new ActionListener(){public void actionPerformed(ActionEvent e) {System.exit(0);}});jmi_5.addActionListener(new ActionListener(){public void actionPerformed(ActionEvent e) {new loan_prop_manage().show();}});jmi_6.addActionListener(new ActionListener(){public void actionPerformed(ActionEvent e) {new property_Info().show();}});jmi_7.addActionListener(new ActionListener(){public void actionPerformed(ActionEvent e) {new prop_info_select().show();}});jmi_8.addActionListener(new ActionListener(){public void actionPerformed(ActionEvent e) {new Loan_prop_select().show();}});jmi_9.addActionListener(new ActionListener(){public void actionPerformed(ActionEvent e) {new back_prop_select ().show();}});jmi_10.addActionListener(new ActionListener(){public void actionPerformed(ActionEvent e) {new about().show();}});this.setBounds(200,200,500,400);this.setDefaultCloseOperation(EXIT_ON_CLOSE);}public void actionPerformed(ActionEvent e) {//System.exit(0);this.setVisible(false);}public static void main(String[] args) {new Sys_interface().show();}}////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////资产借出管理////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////package com.newer.property;import java.awt.*;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import java.sql.*;import java.util.Vector;import javax.swing.*;import java.awt.event.FocusEvent;import java.awt.event.FocusListener;import java.awt.event.MouseEvent;import java.awt.event.MouseListener;import javax.swing.event.ListSelectionEvent;import javax.swing.event.ListSelectionListener;import javax.swing.event.TableModelListener;import javax.swing.event.TableModelEvent;import javax.swing.table.DefaultTableModel;import javax.swing.table.TableModel;public class loan_prop_manage extends JFrame implements ActionListener{ Vector<Vector> data=null;DefaultTableModel model = null;Connection conn=null;Statement stat=null;ResultSet rs1=null;JTable loan_prop=null;JLabel label;JTextField text;JTextField txt01,txt02,txt03,txt04,txt05,txt06;JPanel p1=null,p2=null,p3=null,p4,p5,p6,p7,p8,p9,p10;Choice c1=null,c2=null;JLabel lb1=null,lb2=null,lb3=null,lb4=null,lb5=null,lb6=null;JButton btn_ok=null;JButton btn_exit=null;JButton btn_fresh=null;JButton btn_save=null;JButton btn_del=null;Vector<String> columnName=new Vector();public loan_prop_manage(){text=new JTextField();columnName.add("资产名称"); columnName.add("资产型号"); columnName.add("借出时间"); columnName.add("借出数量"); columnName.add("借出人"); p1=new JPanel();p2=new JPanel();p3=new JPanel();p4=new JPanel();p5=new JPanel();p6=new JPanel();p7=new JPanel();p8=new JPanel();p9=new JPanel();p10=new JPanel();lb2=new JLabel("资产名称");lb3=new JLabel("资产型号");lb4=new JLabel("借出时间");lb5=new JLabel("借出数量");lb6=new JLabel("借出人"); txt01=new JTextField(8);txt02=new JTextField(8);txt03=new JTextField(8);txt04=new JTextField(8);txt05=new JTextField(8);txt06=new JTextField(8);c1=new Choice();c2=new Choice();text=new JTextField(5);c1.add("资产编号");btn_ok=new JButton("确定");btn_exit=new JButton("退出");btn_fresh=new JButton("刷新");btn_save=new JButton("保存");btn_del=new JButton("删除");p1.add(new JLabel("查询字段"));p1.add(c1);p1.add(new JLabel("运算符"));p1.add(c2);p1.add(new JLabel("输入数据"));p1.add(text);p1.add(btn_ok);p1.add(btn_exit);p1.setBorder(BorderFactory.createTitledBorder("请操作"));p3.add(lb1);p4.add(lb2);p4.add(txt02);p5.add(lb3);p5.add(txt03);p6.add(lb4);p6.add(txt04);p7.add(lb5);p7.add(txt05);p8.add(lb6);p8.add(txt06);p10.add(btn_fresh);p10.add(btn_save);p10.add(btn_del);p2.setLayout(new GridLayout(3, 2)); p2.add(p3);p2.add(p4);p2.add(p5);p2.add(p6);p2.add(p7);p2.add(p8);loan_prop=new JTable(this.getDate(),columnName); model = new DefaultTableModel(getDate(),columnName); p9.add(new JScrollPane(loan_prop));this.setLayout(new GridLayout(4, 1));this.add(p1);this.add(p9);this.add(p2);this.add(p10);this.setBounds(400,300,500,400);this.setDefaultCloseOperation(EXIT_ON_CLOSE);this.setTitle("资产借出管理");btn_save.addActionListener(new ActionListener(){public void actionPerformed(ActionEvent arg0){try{Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");conn=DriverManager.getConnection("jdbc:sqlserver://127.0.0.1:1433;Database Name=_property","sa","");stat=conn.createStatement();String sql="insert into loan_info (prop_name,prop_type,loan_time,loan_num)"+"values('"+txt02.getText()+"','"+txt 03.getText()+"','"+txt04.getText()+"','"+txt05.getText()+"')";stat.executeUpdate(sql);DefaultTableModel mod= new DefaultTableModel(getDate(),columnName);loan_prop.setModel(mod);loan_prop.repaint();loan_prop.updateUI();}catch(Exception e){System.out.println(e.getMessage());}try{if(rs1!=null){rs1.close();}if(stat!=null){stat.close();}if(conn!=null){conn.close();}}catch(Exception e2){System.out.println("关闭失败");e2.printStackTrace();}}});btn_ok.addActionListener(new ActionListener(){public void actionPerformed(ActionEvent e) {DefaultTableModel dtb=new DefaultTableModel(selectDate(),columnName);loan_prop.setModel(dtb);loan_prop.repaint();loan_prop.updateUI();}});/*btn_exit.addActionListener(new ActionListener(){public void actionPerformed(ActionEvent arg0){}});*/btn_exit.addActionListener(this);btn_fresh.addActionListener(new ActionListener(){public void actionPerformed(ActionEvent arg0){DefaultTableModel mod = new DefaultTableModel(getDate(),columnName);loan_prop.setModel(mod);loan_prop.repaint();loan_prop.updateUI();}});loan_prop.getSelectionModel().addListSelectionListener(new ListSelectionListener(){public void valueChanged(ListSelectionEvent e){btn_del.addActionListener(new ActionListener(){public void actionPerformed(ActionEvent arg0){try{int j= loan_prop.getSelectedRow();Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");conn=DriverManager.getConnection("jdbc:sqlserver://127.0.0.1:1433;Database Name=_property","sa","");stat=conn.createStatement();String sql1="delete from loan_info where prop_id="+""+data.get(j).get(0)+"";stat.executeUpdate(sql1);}catch(Exception ee){System.out.println(ee.getMessage());}finally{try{if(rs1!=null){rs1.close();}if(stat!=null){stat.close();}if(conn!=null){conn.close();}}catch(Exception e2){System.out.println("关闭失败");e2.printStackTrace();}}DefaultTableModel mod = new DefaultTableModel(getDate(),columnName);loan_prop.setModel(mod);loan_prop.repaint();loan_prop.updateUI();}});}});loan_prop.getSelectionModel().addListSelectionListener( new ListSelectionListener(){public void valueChanged(ListSelectionEvent e){int i= loan_prop.getSelectedRow();txt01.setText(data.get(i).get(0).toString());txt02.setText((String)data.get(i).get(1));txt03.setText((String)data.get(i).get(2));txt04.setText(data.get(i).get(3).toString());txt05.setText(data.get(i).get(4).toString());txt06.setText(data.get(i).get(5).toString());}});}public Vector selectDate(){data=new Vector<Vector>();try{Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");conn=DriverManager.getConnection("jdbc:sqlserver://127.0.0.1:1433;Database Name=_property","sa","");stat=conn.createStatement();int x=Integer.parseInt(text.getText().trim());//System.out.println(x);rs1=stat.executeQuery("select * from loan_info where prop_id="+x);while(rs1.next()){Vector al=new Vector();al.add(rs1.getInt("prop_id"));al.add(rs1.getString("prop_name"));al.add(rs1.getString("prop_type"));al.add(rs1.getDate("loan_time"));al.add(rs1.getInt("loan_num"));al.add(rs1.getString("u_name"));data.add(al);}}catch(Exception e){e.printStackTrace();}finally{try{if(rs1!=null){rs1.close();}if(stat!=null){stat.close();}if(conn!=null){conn.close();}}catch(Exception e2){System.out.println("关闭失败");e2.printStackTrace();}}return data;}public Vector getDate(){data=new Vector<Vector>();try{Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");conn=DriverManager.getConnection("jdbc:sqlserver://127.0.0.1:1433;Database Name=_property","sa","");stat=conn.createStatement();rs1=stat.executeQuery("select * from loan_info");while(rs1.next()){Vector al=new Vector();al.add(rs1.getInt("prop_id"));al.add(rs1.getString("prop_name"));al.add(rs1.getString("prop_type"));al.add(rs1.getDate("loan_time"));al.add(rs1.getInt("loan_num"));al.add(rs1.getString("u_name"));data.add(al);}}catch(Exception e){System.out.println(e.getMessage());}finally{try{if(rs1!=null){rs1.close();}if(stat!=null){stat.close();}if(conn!=null){conn.close();}}catch(Exception e2){System.out.println("关闭失败");e2.printStackTrace();}}return data;}public static void main(String[] args){new loan_prop_manage().show();}public void actionPerformed(ActionEvent e) {//System.exit(0);this.setVisible(false);}}////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////资产借出查询////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////package com.newer.property;import java.sql.*;import java.util.ArrayList;import javax.swing.JButton;import java.awt.event.*;import javax.swing.JTextField;import java.util.Vector;import java.awt.BorderLayout;import java.awt.Choice;import java.awt.FlowLayout;import javax.swing.BorderFactory;import javax.swing.JFrame;import javax.swing.JLabel;import javax.swing.JPanel;import javax.swing.JScrollPane;import javax.swing.JTable;import javax.swing.table.DefaultTableModel;public class Loan_prop_select extends JFrame implements ActionListener{ Connection conn=null;Statement stat=null;ResultSet rs=null;JTable table=null;JLabel label;JTextField text;JButton btn_ok=null,btn_exit=null;JPanel p1=null,p2=null;Vector<String> columnName=new Vector();public Loan_prop_select(){this.setTitle("资产借出查询");columnName.add("流水号");columnName.add("资产编号");columnName.add("借用人");columnName.add("借出数量");columnName.add("借出时间");p1=new JPanel();p2=new JPanel();text=new JTextField();text=new JTextField(5);btn_ok=new JButton("查询");btn_exit=new JButton("退出");p1.add(new JLabel("资产编号"));p1.add(text);p1.add(btn_ok);p1.add(btn_exit);p1.setBorder(BorderFactory.createTitledBorder("数据查询"));btn_exit.addActionListener(this);table=new JTable(this.getDate(),columnName);this.setLayout(new BorderLayout());this.add(p1,BorderLayout.NORTH);this.add(new JScrollPane(table),BorderLayout.CENTER);this.setBounds(400,300,500,400);this.setDefaultCloseOperation(EXIT_ON_CLOSE);btn_ok.addActionListener(new ActionListener() {@Overridepublic void actionPerformed(ActionEvent arg0) {DefaultTableModel dtm=new DefaultTableModel(selectDate(),columnName);table.setModel(dtm);table.repaint();table.updateUI();}});}public Vector selectDate(){Vector<Vector> data=new Vector<Vector>();try{Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");conn=DriverManager.getConnection("jdbc:sqlserver://127.0.0.1:1433;Database Name=_property","sa","");stat=conn.createStatement();int x=Integer.parseInt(text.getText().trim());//System.out.println(x);rs=stat.executeQuery("select * from loan_info where prop_id="+x);while(rs.next()){Vector al=new Vector();al.add(rs.getString("loan_id"));al.add(rs.getString("prop_id"));al.add(rs.getString("u_id"));al.add(rs.getString("loan_num"));al.add(rs.getString("loan_time"));data.add(al);}}catch(Exception e){System.out.println(e.getMessage());}finally{//关闭try{if(rs!=null){rs.close();}if(stat!=null){stat.close();}if(conn!=null){conn.close();}}catch(Exception e2){System.out.println("关闭失败");e2.printStackTrace();}}return data;}public Vector getDate(){Vector<Vector> data=new Vector<Vector>();try{Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");conn=DriverManager.getConnection("jdbc:sqlserver://127.0.0.1:1433;Database Name=_property","sa","");stat=conn.createStatement();rs=stat.executeQuery("select * from loan_Info");while(rs.next()){Vector al=new Vector();al.add(rs.getString("loan_id"));al.add(rs.getString("prop_id"));al.add(rs.getString("u_id"));al.add(rs.getString("loan_num"));al.add(rs.getString("loan_time"));data.add(al);}}catch(Exception e){System.out.println(e.getMessage()); }finally{//关闭try{if(rs!=null){rs.close();}if(stat!=null){stat.close();}if(conn!=null){conn.close();}}catch(Exception e2){System.out.println("关闭失败");e2.printStackTrace();}}return data;}public static void main(String[] args) {new Loan_prop_select().show();}public void actionPerformed(ActionEvent e) {//System.exit(0);this.setVisible(false);}}////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////资产归还查询////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////package com.newer.property;import java.sql.*;import java.util.Vector;import java.awt.BorderLayout;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import java.awt.event.FocusEvent;import java.awt.event.FocusListener;import java.awt.event.MouseEvent;import java.awt.event.MouseListener;import javax.swing.BorderFactory;import javax.swing.JFrame;import javax.swing.JLabel;import javax.swing.JTextField;import javax.swing.JButton;。