Java固定資產(chǎn)管理系統(tǒng)源代碼_第1頁
Java固定資產(chǎn)管理系統(tǒng)源代碼_第2頁
Java固定資產(chǎn)管理系統(tǒng)源代碼_第3頁
Java固定資產(chǎn)管理系統(tǒng)源代碼_第4頁
Java固定資產(chǎn)管理系統(tǒng)源代碼_第5頁
已閱讀5頁,還剩6頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

Java固定資產(chǎn)管理系統(tǒng)源代碼?一、系統(tǒng)概述Java固定資產(chǎn)管理系統(tǒng)是一個(gè)用于企業(yè)或組織對(duì)固定資產(chǎn)進(jìn)行有效管理的軟件系統(tǒng)。它可以實(shí)現(xiàn)固定資產(chǎn)的登記、查詢、修改、折舊計(jì)算、報(bào)廢處理等功能,幫助企業(yè)提高固定資產(chǎn)管理的效率和準(zhǔn)確性,降低管理成本。

二、系統(tǒng)功能模塊1.固定資產(chǎn)登記模塊:用于錄入新的固定資產(chǎn)信息,包括資產(chǎn)編號(hào)、名稱、型號(hào)、購置日期、購置金額、使用部門等。2.固定資產(chǎn)查詢模塊:可以根據(jù)不同條件查詢固定資產(chǎn)信息,如按資產(chǎn)編號(hào)、名稱、使用部門等。3.固定資產(chǎn)修改模塊:對(duì)已登記的固定資產(chǎn)信息進(jìn)行修改。4.折舊計(jì)算模塊:根據(jù)固定資產(chǎn)的折舊方法(如直線折舊法)計(jì)算每月或每年的折舊額。5.報(bào)廢處理模塊:對(duì)已達(dá)到報(bào)廢條件的固定資產(chǎn)進(jìn)行報(bào)廢處理,并記錄相關(guān)信息。

三、數(shù)據(jù)庫設(shè)計(jì)1.固定資產(chǎn)表(fixed_assets)-資產(chǎn)編號(hào)(asset_id):主鍵,唯一標(biāo)識(shí)固定資產(chǎn)。-資產(chǎn)名稱(asset_name):資產(chǎn)的名稱。-型號(hào)(model):資產(chǎn)的型號(hào)。-購置日期(purchase_date):資產(chǎn)的購置時(shí)間。-購置金額(purchase_amount):購置資產(chǎn)的金額。-使用部門(department):資產(chǎn)所屬的部門。-折舊方法(depreciation_method):如直線折舊法等。-折舊年限(depreciation_period):折舊的年限。-已折舊金額(depreciated_amount):累計(jì)已折舊的金額。-凈值(net_value):資產(chǎn)的凈值。-狀態(tài)(status):如正常、報(bào)廢等。2.報(bào)廢記錄表(scrap_records)-報(bào)廢記錄編號(hào)(scrap_id):主鍵。-資產(chǎn)編號(hào)(asset_id):關(guān)聯(lián)固定資產(chǎn)表的資產(chǎn)編號(hào)。-報(bào)廢日期(scrap_date):資產(chǎn)報(bào)廢的時(shí)間。-報(bào)廢原因(scrap_reason):資產(chǎn)報(bào)廢的原因。

四、源代碼實(shí)現(xiàn)1.固定資產(chǎn)登記功能實(shí)現(xiàn)```javaimportjava.sql.Connection;importjava.sql.DriverManager;importjava.sql.PreparedStatement;importjava.sql.SQLException;

publicclassFixedAssetsRegister{privatestaticfinalStringURL="jdbc:mysql://localhost:3306/fixed_assets_db";privatestaticfinalStringUSER="root";privatestaticfinalStringPASSWORD="password";

publicvoidregisterFixedAsset(StringassetId,StringassetName,Stringmodel,StringpurchaseDate,doublepurchaseAmount,Stringdepartment,StringdepreciationMethod,intdepreciationPeriod){try(Connectionconn=DriverManager.getConnection(URL,USER,PASSWORD)){Stringsql="INSERTINTOfixed_assets(asset_id,asset_name,model,purchase_date,purchase_amount,department,depreciation_method,depreciation_period,depreciated_amount,net_value,status)VALUES(?,?,?,?,?,?,?,?,?,?,?)";PreparedStatementpstmt=conn.prepareStatement(sql);pstmt.setString(1,assetId);pstmt.setString(2,assetName);pstmt.setString(3,model);pstmt.setString(4,purchaseDate);pstmt.setDouble(5,purchaseAmount);pstmt.setString(6,department);pstmt.setString(7,depreciationMethod);pstmt.setInt(8,depreciationPeriod);pstmt.setDouble(9,0);pstmt.setDouble(10,purchaseAmount);pstmt.setString(11,"正常");pstmt.executeUpdate();}catch(SQLExceptione){e.printStackTrace();}}}```2.固定資產(chǎn)查詢功能實(shí)現(xiàn)```javaimportjava.sql.Connection;importjava.sql.DriverManager;importjava.sql.PreparedStatement;importjava.sql.ResultSet;importjava.sql.SQLException;

publicclassFixedAssetsQuery{privatestaticfinalStringURL="jdbc:mysql://localhost:3306/fixed_assets_db";privatestaticfinalStringUSER="root";privatestaticfinalStringPASSWORD="password";

publicvoidqueryFixedAssets(Stringcondition){try(Connectionconn=DriverManager.getConnection(URL,USER,PASSWORD)){Stringsql="SELECT*FROMfixed_assetsWHERE"+condition;PreparedStatementpstmt=conn.prepareStatement(sql);ResultSetrs=pstmt.executeQuery();while(rs.next()){StringassetId=rs.getString("asset_id");StringassetName=rs.getString("asset_name");Stringmodel=rs.getString("model");StringpurchaseDate=rs.getString("purchase_date");doublepurchaseAmount=rs.getDouble("purchase_amount");Stringdepartment=rs.getString("department");StringdepreciationMethod=rs.getString("depreciation_method");intdepreciationPeriod=rs.getInt("depreciation_period");doubledepreciatedAmount=rs.getDouble("depreciated_amount");doublenetValue=rs.getDouble("net_value");Stringstatus=rs.getString("status");System.out.println("資產(chǎn)編號(hào):"+assetId+",資產(chǎn)名稱:"+assetName+",型號(hào):"+model+",購置日期:"+purchaseDate+",購置金額:"+purchaseAmount+",使用部門:"+department+",折舊方法:"+depreciationMethod+",折舊年限:"+depreciationPeriod+",已折舊金額:"+depreciatedAmount+",凈值:"+netValue+",狀態(tài):"+status);}rs.close();}catch(SQLExceptione){e.printStackTrace();}}}```3.固定資產(chǎn)修改功能實(shí)現(xiàn)```javaimportjava.sql.Connection;importjava.sql.DriverManager;importjava.sql.PreparedStatement;importjava.sql.SQLException;

publicclassFixedAssetsUpdate{privatestaticfinalStringURL="jdbc:mysql://localhost:3306/fixed_assets_db";privatestaticfinalStringUSER="root";privatestaticfinalStringPASSWORD="password";

publicvoidupdateFixedAsset(StringassetId,StringassetName,Stringmodel,StringpurchaseDate,doublepurchaseAmount,Stringdepartment,StringdepreciationMethod,intdepreciationPeriod){try(Connectionconn=DriverManager.getConnection(URL,USER,PASSWORD)){Stringsql="UPDATEfixed_assetsSETasset_name=?,model=?,purchase_date=?,purchase_amount=?,department=?,depreciation_method=?,depreciation_period=?WHEREasset_id=?";PreparedStatementpstmt=conn.prepareStatement(sql);pstmt.setString(1,assetName);pstmt.setString(2,model);pstmt.setString(3,purchaseDate);pstmt.setDouble(4,purchaseAmount);pstmt.setString(5,department);pstmt.setString(6,depreciationMethod);pstmt.setInt(7,depreciationPeriod);pstmt.setString(8,assetId);pstmt.executeUpdate();}catch(SQLExceptione){e.printStackTrace();}}}```4.折舊計(jì)算功能實(shí)現(xiàn)```javapublicclassDepreciationCalculator{publicdoublecalculateDepreciation(doublepurchaseAmount,intdepreciationPeriod,intmonths){doublemonthlyDepreciation=purchaseAmount/(depreciationPeriod*12);returnmonthlyDepreciation*months;}}```5.報(bào)廢處理功能實(shí)現(xiàn)```javaimportjava.sql.Connection;importjava.sql.DriverManager;importjava.sql.PreparedStatement;importjava.sql.SQLException;

publicclassFixedAssetsScrap{privatestaticfinalStringURL="jdbc:mysql://localhost:3306/fixed_assets_db";privatestaticfinalStringUSER="root";privatestaticfinalStringPASSWORD="password";

publicvoidscrapFixedAsset(StringassetId,StringscrapDate,StringscrapReason){try(Connectionconn=DriverManager.getConnection(URL,USER,PASSWORD)){Stringsql="UPDATEfixed_assetsSETstatus='報(bào)廢'WHEREasset_id=?";PreparedStatementpstmt=conn.prepareStatement(sql);pstmt.setString(1,assetId);pstmt.executeUpdate();

sql="INSERTINTOscrap_records(asset_id,scrap_date,scrap_reason)VALUES(?,?,?)";pstmt=conn.prepareStatement(sql);pstmt.setString(1,assetId);pstmt.setString(2,scrapDate);pstmt.setString(3,scrapReason);pstmt.executeUpdate();}catch(SQLExceptione){e.printStackTrace();}}}```

五、系統(tǒng)使用說明1.啟動(dòng)系統(tǒng):確保MySQL數(shù)據(jù)庫已啟動(dòng)并運(yùn)行,然后運(yùn)行Java項(xiàng)目的主類。2.固定資產(chǎn)登記:-調(diào)用FixedAssetsRegister類的registerFixedAsset方法。-輸入資產(chǎn)編號(hào)、名稱、型號(hào)、購置日期、購置金額、使用部門、折舊方法、折舊年限等信息。3.固定資產(chǎn)查詢:-調(diào)用FixedAssetsQuery類的queryFixedAssets方法。-輸入查詢條件,如按資產(chǎn)編號(hào)查詢"asset_id='xxx'"等。4.固定資產(chǎn)修改:-調(diào)用FixedAssetsUpdate類的updateFixedAsset方法。-輸入要修改的資產(chǎn)編號(hào)及新的資產(chǎn)信息。5.折舊計(jì)算:-調(diào)用DepreciationCalculator類的calculateDepreciation方法。-輸入購置金額、折舊年限

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論