diff --git a/SUBD-back/src/main/java/com/subd/subd/Controllers/DriverController.java b/SUBD-back/src/main/java/com/subd/subd/Controllers/DriverController.java
index 945fa8c..63a6d19 100644
--- a/SUBD-back/src/main/java/com/subd/subd/Controllers/DriverController.java
+++ b/SUBD-back/src/main/java/com/subd/subd/Controllers/DriverController.java
@@ -22,11 +22,11 @@ public class DriverController {
}
@PostMapping("/driver")
public Driver createDriver(@RequestBody Driver driver) {
- return DriverService.addDriver(driver.getName(), driver.getAge(), driver.getPhone(), driver.getEmail());
+ return DriverService.addDriver(driver.getName(), driver.getBirthday(), driver.getPhone(), driver.getEmail());
}
@PutMapping("/driver/{id}")
public Driver updateDriver(@PathVariable Long id, @RequestBody Driver driver) {
- return DriverService.updateDriver(id, driver.getName(), driver.getAge(), driver.getPhone(), driver.getEmail());
+ return DriverService.updateDriver(id, driver.getName(), driver.getBirthday(), driver.getPhone(), driver.getEmail());
}
@DeleteMapping("/driver/{id}")
public Driver deleteDriver(@PathVariable Long id) {
diff --git a/SUBD-back/src/main/java/com/subd/subd/Controllers/OrderController.java b/SUBD-back/src/main/java/com/subd/subd/Controllers/OrderController.java
index 5586956..ae044eb 100644
--- a/SUBD-back/src/main/java/com/subd/subd/Controllers/OrderController.java
+++ b/SUBD-back/src/main/java/com/subd/subd/Controllers/OrderController.java
@@ -23,11 +23,11 @@ public class OrderController {
}
@PostMapping("/order")
public Order createOrder(@RequestBody OrderDto orderDto) {
- return OrderService.addOrder(orderDto.getValue(), orderDto.getClientId(), orderDto.getSourcePickUpPointId(), orderDto.getDestPickUpPointId(), orderDto.getCarId());
+ return OrderService.addOrder(orderDto.getValue(), orderDto.getStatus(), orderDto.getClientId(), orderDto.getSourcePickUpPointId(), orderDto.getDestPickUpPointId(), orderDto.getCarId());
}
@PutMapping("/order/{id}")
public Order updateOrder(@PathVariable Long id, @RequestBody OrderDto orderDto) {
- return OrderService.updateOrder(id, orderDto.getValue(), orderDto.getClientId(), orderDto.getSourcePickUpPointId(), orderDto.getDestPickUpPointId(), orderDto.getCarId());
+ return OrderService.updateOrder(id, orderDto.getValue(), orderDto.getStatus(), orderDto.getClientId(), orderDto.getSourcePickUpPointId(), orderDto.getDestPickUpPointId(), orderDto.getCarId());
}
@DeleteMapping("/order/{id}")
public Order deleteOrder(@PathVariable Long id) {
diff --git a/SUBD-back/src/main/java/com/subd/subd/Dtos/OrderDto.java b/SUBD-back/src/main/java/com/subd/subd/Dtos/OrderDto.java
index f84bae5..ebccfd3 100644
--- a/SUBD-back/src/main/java/com/subd/subd/Dtos/OrderDto.java
+++ b/SUBD-back/src/main/java/com/subd/subd/Dtos/OrderDto.java
@@ -2,13 +2,15 @@ package com.subd.subd.Dtos;
public class OrderDto {
private Double value;
+ private String status;
private Long clientId;
private Long sourcePickUpPointId;
private Long destPickUpPointId;
private Long carId;
public OrderDto() {}
- public OrderDto(Double value, Long clientId, Long sourcePickUpPointId, Long destPickUpPointId, Long carId) {
+ public OrderDto(Double value, String status, Long clientId, Long sourcePickUpPointId, Long destPickUpPointId, Long carId) {
this.value = value;
+ this.status = status;
this.clientId = clientId;
this.sourcePickUpPointId = sourcePickUpPointId;
this.destPickUpPointId = destPickUpPointId;
@@ -17,6 +19,9 @@ public class OrderDto {
public Double getValue() {
return this.value;
}
+ public String getStatus() {
+ return this.status;
+ }
public Long getClientId() {
return this.clientId;
}
diff --git a/SUBD-back/src/main/java/com/subd/subd/Models/Driver.java b/SUBD-back/src/main/java/com/subd/subd/Models/Driver.java
index 6d56399..6090a15 100644
--- a/SUBD-back/src/main/java/com/subd/subd/Models/Driver.java
+++ b/SUBD-back/src/main/java/com/subd/subd/Models/Driver.java
@@ -5,6 +5,7 @@ import jakarta.persistence.GeneratedValue;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
+import java.util.Date;
import java.util.Objects;
@Entity
@@ -14,13 +15,13 @@ public class Driver {
@GeneratedValue
private Long id;
private String name;
- private Integer age;
+ private Date birthday;
private String phone;
private String email;
Driver() {}
- public Driver(String name, Integer age, String phone, String email) {
+ public Driver(String name, Date birthday, String phone, String email) {
this.name = name;
- this.age = age;
+ this.birthday = birthday;
this.phone = phone;
this.email = email;
}
@@ -28,8 +29,8 @@ public class Driver {
public void setId(Long id) { this.id = id; }
public String getName() { return this.name; }
public void setName(String name) { this.name = name; }
- public Integer getAge() { return this.age; }
- public void setAge(Integer age) { this.age = age; }
+ public Date getBirthday() { return this.birthday; }
+ public void setBirthday(Date birthday) { this.birthday = birthday; }
public String getPhone() { return this.phone; }
public void setPhone(String phone) { this.phone = phone; }
public String getEmail() { return this.email; }
@@ -43,19 +44,19 @@ public class Driver {
Driver driver = (Driver) o;
return Objects.equals(this.id, driver.id) &&
Objects.equals(this.name, driver.name) &&
- Objects.equals(this.age, driver.age) &&
+ Objects.equals(this.birthday, driver.birthday) &&
Objects.equals(this.phone, driver.phone) &&
Objects.equals(this.email, driver.email);
}
@Override
public int hashCode() {
- return Objects.hash(this.id, this.name, this.age, this.phone, this.email);
+ return Objects.hash(this.id, this.name, this.birthday, this.phone, this.email);
}
@Override
public String toString() {
return "Client{" + "id=" + this.id +
", name='" + this.name + '\'' +
- ", age='" + this.age + '\'' +
+ ", birthday='" + this.birthday + '\'' +
", phone='" + this.phone + '\'' +
", email='" + this.email + '\'' +
'}';
diff --git a/SUBD-back/src/main/java/com/subd/subd/Models/Order.java b/SUBD-back/src/main/java/com/subd/subd/Models/Order.java
index 9aa34eb..65abd22 100644
--- a/SUBD-back/src/main/java/com/subd/subd/Models/Order.java
+++ b/SUBD-back/src/main/java/com/subd/subd/Models/Order.java
@@ -11,6 +11,7 @@ public class Order {
@GeneratedValue
private Long id;
private Double value;
+ private String status;
@ManyToOne( cascade = {CascadeType.MERGE}, fetch = FetchType.EAGER)
@JoinColumn(name = "Client_id", nullable = true)
private Client client;
@@ -24,8 +25,9 @@ public class Order {
@JoinColumn(name = "Car_id", referencedColumnName = "id")
private Car car;
Order() {}
- public Order(Double value, Client client, PickUpPoint sourcePickUpPoint, PickUpPoint destPickUpPoint, Car car) {
+ public Order(Double value, String status, Client client, PickUpPoint sourcePickUpPoint, PickUpPoint destPickUpPoint, Car car) {
this.value = value;
+ this.status = status;
this.client = client;
this.sourcePickUpPoint = sourcePickUpPoint;
this.destPickUpPoint = destPickUpPoint;
@@ -43,6 +45,12 @@ public class Order {
public void setValue(Double value) {
this.value = value;
}
+ public String getStatus() {
+ return this.status;
+ }
+ public void setStatus(String status) {
+ this.status = status;
+ }
public Client getClient() {
return client;
}
@@ -81,6 +89,7 @@ public class Order {
Order order = (Order) o;
return Objects.equals(this.id, order.id) &&
Objects.equals(this.value, order.value) &&
+ Objects.equals(this.status, order.status) &&
Objects.equals(this.client, order.client) &&
Objects.equals(this.sourcePickUpPoint, order.sourcePickUpPoint) &&
Objects.equals(this.destPickUpPoint, order.destPickUpPoint) &&
@@ -88,12 +97,13 @@ public class Order {
}
@Override
public int hashCode() {
- return Objects.hash(this.id, this.value, this.client, this.sourcePickUpPoint, destPickUpPoint, car);
+ return Objects.hash(this.id, this.value, this.status, this.client, this.sourcePickUpPoint, destPickUpPoint, car);
}
@Override
public String toString() {
return "Client{" + "id=" + this.id +
", value='" + this.value + '\'' +
+ ", status='" + this.status + '\'' +
", client='" + this.client + '\'' +
", sourcePickUpPoint='" + this.sourcePickUpPoint + '\'' +
", destPickUpPoint='" + this.destPickUpPoint + '\'' +
diff --git a/SUBD-back/src/main/java/com/subd/subd/Services/DriverService.java b/SUBD-back/src/main/java/com/subd/subd/Services/DriverService.java
index eb6933f..0cfbf8d 100644
--- a/SUBD-back/src/main/java/com/subd/subd/Services/DriverService.java
+++ b/SUBD-back/src/main/java/com/subd/subd/Services/DriverService.java
@@ -6,6 +6,7 @@ import com.subd.subd.Repositories.DriverRepository;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
+import java.util.Date;
import java.util.List;
import java.util.Optional;
@@ -16,8 +17,8 @@ public class DriverService {
this.driverRepository = driverRepository;
}
@Transactional
- public Driver addDriver(String name, Integer age, String phone, String email) {
- final Driver driver = new Driver(name, age, phone, email);
+ public Driver addDriver(String name, Date birthday, String phone, String email) {
+ final Driver driver = new Driver(name, birthday, phone, email);
return driverRepository.save(driver);
}
@Transactional(readOnly = true)
@@ -30,13 +31,13 @@ public class DriverService {
return driverRepository.findAll();
}
@Transactional
- public Driver updateDriver(Long id, String name, Integer age, String phone, String email) {
+ public Driver updateDriver(Long id, String name, Date birthday, String phone, String email) {
final Driver currentDriver = findDriver(id);
if (name != null) {
currentDriver.setName(name);
}
- if (age != null) {
- currentDriver.setAge(age);
+ if (birthday != null) {
+ currentDriver.setBirthday(birthday);
}
if (phone != null) {
currentDriver.setPhone(phone);
diff --git a/SUBD-back/src/main/java/com/subd/subd/Services/OrderService.java b/SUBD-back/src/main/java/com/subd/subd/Services/OrderService.java
index cef05bd..633c670 100644
--- a/SUBD-back/src/main/java/com/subd/subd/Services/OrderService.java
+++ b/SUBD-back/src/main/java/com/subd/subd/Services/OrderService.java
@@ -31,7 +31,7 @@ public class OrderService {
this.carRepository = carRepository;
}
@Transactional
- public Order addOrder(Double value, Long clientId, Long sourcePickUpPointId, Long destPickUpPointId, Long carId) {
+ public Order addOrder(Double value, String status, Long clientId, Long sourcePickUpPointId, Long destPickUpPointId, Long carId) {
final Client client = clientRepository.findById(clientId)
.orElseThrow(() -> new ClientNotFoundException(clientId));
final PickUpPoint sourcePickUpPoint = pickUpPointRepository.findById(sourcePickUpPointId)
@@ -40,7 +40,7 @@ public class OrderService {
.orElseThrow(() -> new PickUpPointNotFoundException(destPickUpPointId));
final Car car = carRepository.findById(carId)
.orElseThrow(() -> new CarNotFoundException(carId));
- final Order order = new Order(value, client, sourcePickUpPoint, destPickUpPoint, car);
+ final Order order = new Order(value, status, client, sourcePickUpPoint, destPickUpPoint, car);
return orderRepository.save(order);
}
@Transactional(readOnly = true)
@@ -53,11 +53,14 @@ public class OrderService {
return orderRepository.findAll();
}
@Transactional
- public Order updateOrder(Long id, Double value, Long clientId, Long sourcePickUpPointId, Long destPickUpPointId, Long carId) {
+ public Order updateOrder(Long id, Double value, String status, Long clientId, Long sourcePickUpPointId, Long destPickUpPointId, Long carId) {
final Order currentOrder = findOrder(id);
if (value != null) {
currentOrder.setValue(value);
}
+ if (status != null) {
+ currentOrder.setStatus(status);
+ }
if (clientId != null) {
final Client client = clientRepository.findById(clientId)
.orElseThrow(() -> new ClientNotFoundException(clientId));
diff --git a/SUBD-front/main.js b/SUBD-front/main.js
new file mode 100644
index 0000000..7baf981
--- /dev/null
+++ b/SUBD-front/main.js
@@ -0,0 +1,30 @@
+import { createApp } from 'vue'
+import { createRouter, createWebHistory } from 'vue-router'
+import './style.css'
+import App from './App.vue'
+import Catalogs from './components/Catalogs.vue'
+import CatalogStudents from './components/CatalogStudents.vue'
+import CatalogGroups from './components/CatalogGroups.vue'
+import CatalogDisciplines from './components/CatalogDisciplines.vue'
+import Reports from './components/Reports.vue'
+import ReportGroupStudents from './components/ReportGroupStudents.vue'
+import ReportGroupDisciplines from './components/ReportGroupDisciplines.vue'
+
+const routes = [
+ { path: '/', redirect: '/catalogs/students' },
+ { path: '/catalogs', component: Catalogs, meta: { label: 'Справочники' } },
+ { path: '/catalogs/students', component: CatalogStudents },
+ { path: '/catalogs/groups', component: CatalogGroups },
+ { path: '/catalogs/disciplines', component: CatalogDisciplines },
+ { path: '/reports', component: Reports, meta: { label: 'Отчеты' } },
+ { path: '/reports/group-students', component: ReportGroupStudents },
+ { path: '/reports/group-disciplines', component: ReportGroupDisciplines }
+]
+
+const router = createRouter({
+ history: createWebHistory(),
+ linkActiveClass: 'active',
+ routes
+})
+
+createApp(App).use(router).mount('#app')
\ No newline at end of file
diff --git a/SUBD-front/src/App.vue b/SUBD-front/src/App.vue
index 7cb90de..406f563 100644
--- a/SUBD-front/src/App.vue
+++ b/SUBD-front/src/App.vue
@@ -1,5 +1,6 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/SUBD-front/src/components/CatalogGroups.vue b/SUBD-front/src/components/CatalogGroups.vue
new file mode 100644
index 0000000..b7ac5ac
--- /dev/null
+++ b/SUBD-front/src/components/CatalogGroups.vue
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/SUBD-front/src/components/CatalogStudents.vue b/SUBD-front/src/components/CatalogStudents.vue
new file mode 100644
index 0000000..2a8aad0
--- /dev/null
+++ b/SUBD-front/src/components/CatalogStudents.vue
@@ -0,0 +1,82 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/SUBD-front/src/components/Catalogs.vue b/SUBD-front/src/components/Catalogs.vue
new file mode 100644
index 0000000..8480eb4
--- /dev/null
+++ b/SUBD-front/src/components/Catalogs.vue
@@ -0,0 +1,23 @@
+
+
+
+
+
+ {{ catalog.label }}
+
+
+
\ No newline at end of file
diff --git a/SUBD-front/src/components/DataTable.vue b/SUBD-front/src/components/DataTable.vue
new file mode 100644
index 0000000..f24eb88
--- /dev/null
+++ b/SUBD-front/src/components/DataTable.vue
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+
#
+
{{ header.label }}
+
+
+
+
+
{{ index + 1 }}
+
+ {{ item[header.name] }}
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/SUBD-front/src/components/Header.vue b/SUBD-front/src/components/Header.vue
index 0067085..162c8d6 100644
--- a/SUBD-front/src/components/Header.vue
+++ b/SUBD-front/src/components/Header.vue
@@ -1,45 +1,35 @@
+
+
-