Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Insurance yeo #9

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/Insurance_rock/
2 changes: 0 additions & 2 deletions Insurance_rock/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,5 @@
</attributes>
</classpathentry>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="/Insurance_2022"/>
<classpathentry kind="lib" path="C:/Users/ansm6/OneDrive/바탕 화면/mysql-connector-java-8.0.13/mysql-connector-java-8.0.13/mysql-connector-java-8.0.13.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
1 change: 1 addition & 0 deletions Insurance_rock/DB/newContract.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
123
15 changes: 0 additions & 15 deletions Insurance_rock/bin/.gitignore

This file was deleted.

Binary file modified Insurance_rock/bin/Accident/Accident.class
Binary file not shown.
Binary file modified Insurance_rock/bin/Accident/AccidentList.class
Binary file not shown.
Binary file modified Insurance_rock/bin/Accident/AccidentListImpl.class
Binary file not shown.
Binary file modified Insurance_rock/bin/Account/Account.class
Binary file not shown.
Binary file modified Insurance_rock/bin/Channel/Channel.class
Binary file not shown.
Binary file modified Insurance_rock/bin/Channel/ChannelList.class
Binary file not shown.
Binary file modified Insurance_rock/bin/Channel/ChannelListImpl.class
Binary file not shown.
Binary file modified Insurance_rock/bin/CompensateTeam/DamageAssessment.class
Binary file not shown.
Binary file modified Insurance_rock/bin/Contract/Contract.class
Binary file not shown.
Binary file modified Insurance_rock/bin/Contract/ContractList.class
Binary file not shown.
Binary file modified Insurance_rock/bin/Contract/ContractListImpl.class
Binary file not shown.
Binary file modified Insurance_rock/bin/Customer/Customer$Esex.class
Binary file not shown.
Binary file modified Insurance_rock/bin/Customer/Customer.class
Binary file not shown.
Binary file modified Insurance_rock/bin/Customer/CustomerList.class
Binary file not shown.
Binary file modified Insurance_rock/bin/Customer/CustomerListImpl.class
Binary file not shown.
Binary file modified Insurance_rock/bin/FinancialDirector/InsuranceJudge.class
Binary file not shown.
Binary file modified Insurance_rock/bin/Insurance/GeneralInsurance.class
Binary file not shown.
Binary file modified Insurance_rock/bin/Insurance/HouseInsurance.class
Binary file not shown.
Binary file modified Insurance_rock/bin/Insurance/Insurance$EInsurance.class
Binary file not shown.
Binary file modified Insurance_rock/bin/Insurance/Insurance.class
Binary file not shown.
Binary file modified Insurance_rock/bin/Insurance/InsuranceList.class
Binary file not shown.
Binary file modified Insurance_rock/bin/Insurance/InsuranceListImpl.class
Binary file not shown.
Binary file modified Insurance_rock/bin/Main/Main.class
Binary file not shown.
Binary file modified Insurance_rock/bin/Payment/Payment$EInsuranceType.class
Binary file not shown.
Binary file modified Insurance_rock/bin/Payment/Payment.class
Binary file not shown.
Binary file modified Insurance_rock/bin/Payment/PaymentList.class
Binary file not shown.
Binary file modified Insurance_rock/bin/Payment/PaymentListImpl.class
Binary file not shown.
Binary file modified Insurance_rock/bin/Policyholder/FeePayment.class
Binary file not shown.
Binary file modified Insurance_rock/bin/Provision/Provision$einsuranceType.class
Binary file not shown.
Binary file modified Insurance_rock/bin/Provision/Provision.class
Binary file not shown.
Binary file modified Insurance_rock/bin/Provision/ProvisionList.class
Binary file not shown.
Binary file modified Insurance_rock/bin/Provision/ProvisionListImpl.class
Binary file not shown.
Binary file modified Insurance_rock/bin/SalesTeam/ChannelManagement.class
Binary file not shown.
Binary file modified Insurance_rock/bin/SalesTeam/CustomerManagement.class
Binary file not shown.
Binary file modified Insurance_rock/bin/SalesTeam/InsuranceSales.class
Binary file not shown.
Binary file modified Insurance_rock/bin/User/CompensateTeam.class
Binary file not shown.
Binary file modified Insurance_rock/bin/User/ContractTeam.class
Binary file not shown.
Binary file modified Insurance_rock/bin/User/FinancialDirector.class
Binary file not shown.
Binary file modified Insurance_rock/bin/User/SalesTeam.class
Binary file not shown.
Binary file added Insurance_rock/bin/dao/AccidentDao.class
Binary file not shown.
Binary file added Insurance_rock/bin/dao/ApplyContractDao.class
Binary file not shown.
Binary file added Insurance_rock/bin/dao/ContractAccidentDao.class
Binary file not shown.
Binary file added Insurance_rock/bin/dao/ContractDao.class
Binary file not shown.
Binary file added Insurance_rock/bin/dao/CustomerDao.class
Binary file not shown.
Binary file added Insurance_rock/bin/dao/CustomerRankDao.class
Binary file not shown.
Binary file added Insurance_rock/bin/dao/Dao.class
Binary file not shown.
Binary file added Insurance_rock/bin/dao/FailContractDao.class
Binary file not shown.
Binary file added Insurance_rock/bin/dao/GeneralRateDao.class
Binary file not shown.
Binary file added Insurance_rock/bin/dao/HouseRateDao.class
Binary file not shown.
Binary file added Insurance_rock/bin/dao/IRankDao.class
Binary file not shown.
Binary file added Insurance_rock/bin/dao/InsuranceDao.class
Binary file not shown.
Binary file added Insurance_rock/bin/dao/PaymentDao.class
Binary file not shown.
Binary file added Insurance_rock/bin/dao/ProvisionDao.class
Binary file not shown.
Binary file added Insurance_rock/bin/dao/RegisterGeneralRateDao.class
Binary file not shown.
Binary file added Insurance_rock/bin/dao/RegisterHouseRate.class
Binary file not shown.
Binary file added Insurance_rock/bin/dao/RegisterInsuranceDao.class
Binary file not shown.
Binary file added Insurance_rock/bin/dao/RenewContractDao.class
Binary file not shown.
171 changes: 80 additions & 91 deletions Insurance_rock/src/Accident/Accident.java
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
package Accident;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.sql.ResultSet;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;

import dao.AccidentDao;

//121234536456123
/**
Expand All @@ -21,23 +13,30 @@
*/
public class Accident {

private LocalDate accidentDate;
private String content;
private String ID;
private String contractID;
private String customerID;
private String customerName;
private String phoneNum;
private LocalDate accidentDate;
private String content;
private int totalCost;
private int damagePer;
private String ID;
private String kindOfCost;
private int liablityCost;
private int liablityRate;
private boolean payCompleted;
private String phoneNum;
private int totalCost;
private File file;

// AccidentListImpl accidentListimpl;
private int liablityRate;
private int liablityCost;
private AccidentDao accidentDAO;
private int Num;
public String getCustomerID() {
return customerID;
}

public void setCustomerID(String customerID) {
this.customerID = customerID;
}
public Accident() {

this.accidentDAO = new AccidentDao();
}

public LocalDate getAccidentDate() {
Expand Down Expand Up @@ -140,87 +139,77 @@ public void finalize() throws Throwable {

}

public void add() {

if (!file.exists()) {
try {
file.createNewFile();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} else {
try {
FileWriter fileWriter = new FileWriter(file, true);
int payCompletedCheck = 0;
if (this.payCompleted) {
payCompletedCheck = 1;
}
// 사고번호ID, 계약번호 ,가입자명, 연락처,사고날짜,사고내용 ,손해정도,비용종류,지급여부,총비용,책임비용,책임비율
fileWriter.write(this.getID() + " " + this.getContractID() + " " + this.getCustomerName() + " "
+ this.getPhoneNum() + " " + this.getAccidentDate() + " " + this.getContent() + " "
+ this.getDamagePer() + " " + this.getKindOfCost() + " " + payCompletedCheck + " "
+ this.getTotalCost() + " " + this.getLiablityCost() + " " + this.getLiablityRate() + "\n");
public boolean edit() {
return true;
}

fileWriter.close();
public int getNum() {
return Num;
}

public void setNum(int num) {
Num = num;
}


} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public void survey() {

}

public boolean edit() {
return true;




public boolean addaccident() {//사고번호ID, 계약ID ,고객ID,가입자명, 연락처,사고날짜,사고내용 ,총비용,손해정도,비용종류,지급여부,책임비율,책임비용
//
return accidentDAO.creat(this);
// TODO Auto-generated method stub

}

public void search(String customerName_inser, LocalDate accidentDate_inser, boolean empty) {
// 검색한것을 보여줄려면...? 가입자명과 사고날짜가 같다면. 거기에 해당하는 파일 내용 보여주기.
Path path = Paths.get(".//DB//Accident_DB.txt");
Charset cs = StandardCharsets.UTF_8;
List<String> list = new ArrayList<String>();
String[] readfilesplit = null;
try {
list = Files.readAllLines(path,cs);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
for(String readLine : list) {
readfilesplit = readLine.split(" ");
String strDate = readfilesplit[4];
DateTimeFormatter format = DateTimeFormatter.ofPattern("yyyy-MM-dd");
LocalDate strToLocalDateTime = LocalDate.parse(strDate, format);
public ResultSet retriveaccident() {
// TODO Auto-generated method stub
return accidentDAO.retriveaccident(this);

if(readfilesplit[2].equals(customerName_inser) && strToLocalDateTime.isEqual(accidentDate_inser)) {
System.out.println(readLine);
System.out.println(customerName_inser+"님의 해당 사고날짜의 정보가 출력되었습니다.");
empty = false;
}
}

// 다읽어보구... 해당하는것만 set해서 넣어... 그리고 get으로 가져와.
// set의 정보와 VectorList의 비교는 다름! set한것을 Vertor에 넣기!

// //사고번호ID, 계약번호 ,가입자명, 연락처,사고날짜,사고내용 ,손해정도,비용종류,지급여부,총비용,책임비용,책임비율
// this.setID(readfilesplit[0]);
// this.setContractID(readfilesplit[1]);
// this.setCustomerName(readfilesplit[2]);
// this.setPhoneNum(readfilesplit[3]);
// this.setAccidentDate(readfilesplit[4]);
// this.setContent(readfilesplit[5]);
// this.setDamagePer(readfilesplit[6]);
// this.setKindOfCost(readfilesplit[7]);
// this.setPayCompleted(readfilesplit[8]);
// this.setTotalCost(readfilesplit[9]);
// this.setLiablityCost(readfilesplit[10]);
// this.setLiablityRate(readfilesplit[11]);
}




public boolean updatedate(LocalDate accidentdate) {
return accidentDAO.updatedate(this , accidentdate);
}

public void survey() {
public void updatecontent(String content) {
accidentDAO.updatecontent(this , content);

}
public void updatetotal(int totalCost) {
accidentDAO.updatetotal(this , totalCost);

}

public void updateDamage(int damagePer) {
accidentDAO.updateDamage(this , damagePer);

}

public void updateKind(String kindOfCost) {
accidentDAO.updateKind(this , kindOfCost);
}

public void updateLiablityCost(int liablityCost) {
accidentDAO.updateLiablityCost(this , liablityCost);
}

public void updateLiablityRate(int liablityRate) {
accidentDAO.updateLiablityRate(this , liablityRate);

}





}// end Accident
7 changes: 5 additions & 2 deletions Insurance_rock/src/Accident/AccidentList.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package Accident;

import java.sql.ResultSet;
import java.time.LocalDate;
import java.util.ArrayList;


Expand All @@ -11,9 +13,10 @@
public interface AccidentList {
public boolean add(Accident accident);
public boolean delete(String ID);
public void update();
public ResultSet update();

public ArrayList<Accident> get(String phoneNum, String customerName);
public ArrayList<Accident> get(String customerName_inser, String phoneNum_inser);
public ArrayList<Accident> getAll();


}//end AccidentList
78 changes: 75 additions & 3 deletions Insurance_rock/src/Accident/AccidentListImpl.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
package Accident;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.UUID;

import Contract.Contract;
import dao.AccidentDao;
import dao.ContractDao;


/**
Expand All @@ -11,14 +19,28 @@
public class AccidentListImpl implements AccidentList {

private ArrayList<Accident> accidentList = new ArrayList<Accident>();
private AccidentDao accidentDAO;

public AccidentListImpl(){
this.accidentDAO = new AccidentDao();

// this.setAccident();

}

private void setAccident() {
ResultSet resultSet = accidentDAO.retrive();

//사고번호ID, 계약ID ,고객ID,가입자명, 연락처,사고날짜,사고내용 ,총비용,손해정도,비용종류,지급여부,책임비율,책임비용



}

public void finalize() throws Throwable {

}

public boolean add(Accident accident){
if(this.accidentList.add(accident)) {
return true;
Expand All @@ -33,14 +55,40 @@ public boolean delete(String ID){
return false;
}

public void update(){


public ArrayList<Accident> get(String customerName_inser, String phoneNum_inser) {
ArrayList<Accident> inforAccident = new ArrayList<Accident>();
for(Accident accident: this.accidentList) {
if(accident.getCustomerName().equals(customerName_inser) && accident.getPhoneNum().equals(phoneNum_inser)) {
inforAccident.add(accident);
}
}

if(!(inforAccident.isEmpty())) {
return inforAccident;
}
// TODO Auto-generated method stub
return null;
}

@Override
public ArrayList<Accident> getAll() {
return this.accidentList;
}

public ArrayList<Accident> get(String phoneNum, String customerName) {
public void getcontract() {

// TODO Auto-generated method stub

}



public ArrayList<Accident> get(String customerName_inser, LocalDate accidentDate_inser) {
ArrayList<Accident> inforAccident = new ArrayList<Accident>();
for(Accident accident: this.accidentList) {
if(accident.getPhoneNum().equals(phoneNum) && accident.getCustomerName().equals(customerName)) {
if(accident.getCustomerName().equals(customerName_inser) && accident.getAccidentDate().isEqual(accidentDate_inser)) {
inforAccident.add(accident);
}
}
Expand All @@ -51,4 +99,28 @@ public ArrayList<Accident> get(String phoneNum, String customerName) {
// TODO Auto-generated method stub
return null;
}

public Accident getNum(int num) {
for(Accident accident: this.accidentList) {
if(accident.getNum() == num ) {
return accident;
}
}
// TODO Auto-generated method stub
return null;

}

@Override
public ResultSet update() {
// TODO Auto-generated method stub
return null;
}







}//end AccidentListImpl
Loading