Giter VIP home page Giter VIP logo

sta-proj's People

Contributors

mazurkate8 avatar mazurmaksim avatar mykhailomelnik avatar

Watchers

 avatar

sta-proj's Issues

В контроллері створиnи ендпоінт на завантаження xlsx

В контроллері net.students.accounting.controller.MainController створити два ендпоінта для завантаження xlsx файлів.

  1. /students/xlsx/download/{id} - завантажує файл з інформацією про одного студента.
  2. /students/xlsx/download/list - завантажує файл зі всіма студентами які записані в базі
  3. Створити тестові данні, заповнити базу студентами
  4. Перевірити

Процесор який створює файл net.students.accounting.controller.MainController
Маппер net.students.accounting.mapper.StudentListDataMapper

Приклад як можна реалізувати завантаження файла

Контроллер

 @GetMapping("/cryptocurrencies/csv")
    public void exportToCsv(HttpServletResponse servletResponse) throws IOException {
        servletResponse.setContentType("text/csv");
        servletResponse.addHeader("Content-Disposition","attachment; filename=\"statistics.csv\"");
        csvExportService.writeStatisticToCsv(servletResponse.getWriter());
    }

шось подібне має бути для xlsx

Написати тест.

Add Exception Handler

Create package exception, then add two classes CustomizedResponseEntityExceptionHandler (has to extends from ResponseEntityExceptionHandler) and ExceptionResponse.

    @ExceptionHandler(UserNotFoundException.class)
    public final ResponseEntity<Object> handleUserNotFoundExceptions(Exception ex, WebRequest request) {
        ExceptionResponse exceptionResponse =
                new ExceptionResponse(new Date(), ex.getMessage(),
                                      request.getDescription(false));
        return new ResponseEntity(exceptionResponse, HttpStatus.NOT_FOUND);
    }

And for other exceptions

    @ExceptionHandler(Exception.class)
    public final ResponseEntity<Object> handleAllExceptions(Exception ex, WebRequest request) {
     ExceptionResponse exceptionResponse =
             new ExceptionResponse(new Date(), ex.getMessage(),
                                   request.getDescription(false));
     return new ResponseEntity(exceptionResponse, HttpStatus.INTERNAL_SERVER_ERROR);
    }

Fix tests if it needed

In Controller class you have to throw exceptions if student not found. And customize Response entities. Check response codes.

Realize xls output report

Realize xls report with all data about students. Make cells

|Name| Last Name| Middle Name| Group| Inn | Grants | Phone Number |


Довідник податків

Додати в базу довідник податків, з цього довідника мають братись значення для оподаткування стипендії і військового зборів.
Створити сутність

TaxDictionary -
armyTax - військовий податок
incomeTax - податок на прибуток
subsistenceLevel - прожитковий мінімум

Додати репозиторій і сервіси.

Розрахунок військовий збір

Якщо розмір стипендіі перевищує 3180 - це прожитковий мінімум помножено на 1,4
то рахувати податок

Військовий збір - 1,5%
Формула - 3592.5 - (3592.5-3180) *1,5%

де 3592.5 це стипендія студента.

Дані брати з створеного довідника #27

Fix mapper to new Entity

When i add grants entity then broke mapper net.students.accounting.mapper.StudentDataMapper. Fix mapper and write test. Fix other tests if needed

Розрахунок податок на дохід

изображение

Якщо розмір стипендіі перевищує 3180 - це прожитковий мінімум помножено на 1,4
то рахувати податок

Податок на доходи - 18%
Формула - 3592.5 - (3592.5-3180) *18%

де 3592.5 це стипендія студента.

Дані брати з створеного довідника #27

Створити довідник ставки податків

Додати в базу довідник податків, з цього довідника мають братись значення для оподаткування стипендії і військового зборів.
Створити сутність

TaxDictionary -
armyTax - військовий податок
incomeTax - податок на прибуток
subsistenceLevel - прожитковий мінімум

Тести

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.