Skip to content

Commit

Permalink
Start work on documents manipulation
Browse files Browse the repository at this point in the history
TODO:
DOCUMENT MANIPULATION
DOCUMENT FILE MANIPULATION
TASK MANIPULATION
SHOW CONTEOLLED TASK FOR USER
SHOW USERS TASK
STOREHAUSE MANIPULATION
GOOD PRODUCTION AND SERVICE
  • Loading branch information
FairWindCo committed Oct 18, 2015
1 parent 46b95f0 commit ec92c31
Show file tree
Hide file tree
Showing 9 changed files with 294 additions and 104 deletions.
8 changes: 8 additions & 0 deletions .idea/resourceBundles.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.propertyeditors.CustomDateEditor;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;
import org.springframework.security.access.annotation.Secured;
Expand All @@ -12,10 +13,12 @@
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.*;
import ua.pp.fairwind.favorid.internalDB.jgrid.JGridRowsResponse;
import ua.pp.fairwind.favorid.internalDB.jgrid.JSComboExpenseResp;
import ua.pp.fairwind.favorid.internalDB.model.Agreement;
import ua.pp.fairwind.favorid.internalDB.model.Contact;
import ua.pp.fairwind.favorid.internalDB.model.Counterparty;
import ua.pp.fairwind.favorid.internalDB.model.Person;
import ua.pp.fairwind.favorid.internalDB.model.proxy.CounterpartProxy;
import ua.pp.fairwind.favorid.internalDB.repository.AgrimentRepository;
import ua.pp.fairwind.favorid.internalDB.repository.ContactRepository;
import ua.pp.fairwind.favorid.internalDB.repository.CounterpartyRepository;
Expand All @@ -26,6 +29,7 @@
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;


/**
Expand Down Expand Up @@ -405,6 +409,44 @@ public void personsEditor(@RequestParam String oper,@RequestParam long ID,Person
}
}

@Transactional(readOnly = true)
@RequestMapping(value = "/showList", method = RequestMethod.GET)
@ResponseBody
public Object simpleClientList(@RequestParam(required = false) Integer page_num, @RequestParam(required = false) Integer per_page,@RequestParam(value = "pkey_val[]",required = false) String pkey,@RequestParam(value = "q_word[]",required = false) String[] qword) {
//Sort sort= FormSort.formSortFromSortDescription(orderby);
Sort sort=new Sort(Sort.Direction.ASC,"shortName");
PageRequest pager=null;
if(page_num!=null && per_page!=null) {
pager = new PageRequest(page_num - 1, per_page, sort);
}
if(pager!=null) {
Page<CounterpartProxy> page;
if (qword != null && qword.length > 0) {
page = counterpartyRepository.findCounterpart(qword[0], pager);
} else {
page = counterpartyRepository.findCounterpart(pager);
}
return new JSComboExpenseResp<>(page);
} else {
if(pkey!=null && !pkey.isEmpty()){
Long key=Long.valueOf(pkey);
Counterparty ft=null;
if(key!=null) {
ft = counterpartyRepository.findOne(key);
}
return ft;
} else {
List<CounterpartProxy> page;
if (qword != null && qword.length > 0) {
page = counterpartyRepository.findCounterpart("%" + qword[0] + "%", sort);
} else {
page = counterpartyRepository.findCounterpart(sort);
}
return new JSComboExpenseResp<>(page);
}
}
}

@InitBinder
private void dateBinder(WebDataBinder binder) {
//The date format to parse or output your dates
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package ua.pp.fairwind.favorid.internalDB.model.proxy;

/**
* Created by Ñåðãåé on 18.10.2015.
*/
public class CounterpartProxy {
final long id;
final String shortName;
final String fullName;

public CounterpartProxy(long id, String shortName, String fullName) {
this.id = id;
this.shortName = shortName;
this.fullName = fullName;
}

public long getId() {
return id;
}

public String getShortName() {
return shortName;
}

public String getFullName() {
return fullName;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import ua.pp.fairwind.favorid.internalDB.model.Contact;
import ua.pp.fairwind.favorid.internalDB.model.Counterparty;
import ua.pp.fairwind.favorid.internalDB.model.Person;
import ua.pp.fairwind.favorid.internalDB.model.proxy.CounterpartProxy;

import java.util.List;

Expand Down Expand Up @@ -39,4 +40,13 @@ public interface CounterpartyRepository extends JpaRepository<Counterparty,Long>
@Query("select c from Contact c,Counterparty f where f.id=:ID and c member of f.contacts")
List<Contact> getContacts(@Param("ID") long id);

@Query("select new ua.pp.fairwind.favorid.internalDB.model.proxy.CounterpartProxy(c.id,c.shortName,c.fullName) from Counterparty c where c.shortName like %:search%")
Page<CounterpartProxy> findCounterpart(@Param("search")String search,Pageable pager);
@Query("select new ua.pp.fairwind.favorid.internalDB.model.proxy.CounterpartProxy(c.id,c.shortName,c.fullName) from Counterparty c where c.shortName like %:search%")
List<CounterpartProxy> findCounterpart(@Param("search")String search,Sort sort);
@Query("select new ua.pp.fairwind.favorid.internalDB.model.proxy.CounterpartProxy(c.id,c.shortName,c.fullName) from Counterparty c")
Page<CounterpartProxy> findCounterpart(Pageable pager);
@Query("select new ua.pp.fairwind.favorid.internalDB.model.proxy.CounterpartProxy(c.id,c.shortName,c.fullName) from Counterparty c")
List<CounterpartProxy> findCounterpart(Sort sort);

}
81 changes: 9 additions & 72 deletions src/main/resources/label_en_US.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,82 +9,11 @@ label.administrate = Administrate
label.administrate.users = Users
label.administrate.users.title = System users
label.main = Home
label.administrate.subdivisions = Division
label.administrate.subdivisions.title = Reference Units
label.subdivisionstables = Table of units in the organization
label.version = Version
label.subdivisionstables.name = division title
label.categorytables = Category List
label.direcotry = Directories
label.direcotry.category = Categories
label.direcotry.category.title = Directory categories
label.infotables = Table of types of information
label.direcotry.info = Information types
label.direcotry.info.title = Handbook of information types
label.edit.persons.title = Personal Information
label.edit.persons.info_title = Personal Information
label.edit.persons.passportInfo = Paspot information
label.edit.persons.hobbie_ids = Hobie
label.edit.persons.hobbiesComments = Comments to Hobie
label.edit.persons.activities_ids = Activity
label.edit.persons.activitiesComments = Comment to the occupation
label.edit.persons.additional_title = Additional information
label.edit.persons.sergments_ids = Segment
label.edit.persons.clientColorCode = Color client
label.edit.persons.clientColorComments = Comment to the color of the client
label.edit.persons.photo_title = Photo
label.edit.persons.photo_file = File
label.edit.persons.photo_file_comments = comment for this picture
label.edit.persons.photo_file_type = type
label.edit.persons.submit = Save
label.persons = information about people
label.persons.person = Clients
label.persons.person.title = Customer List
label.clientstables = TABLE customers
label.clientstables.col_title.fio = Name
label.clientstables.col_title.code = ID cards
label.clientstables.col_title.bethday = Date of Birth
label.clientstables.col_title.status = Status
label.clientstables.col_title.dossers = Dossier
label.clientstables.dossers = dossier
label.clientstables.dosers.col_title.subdiv = Division
label.clientstables.dosers.col_title.confidentional = Confidential
label.clientstables.dosers.col_title.categeory = Category
label.clientstables.dosers.col_title.info = Type of information
label.clientstables.dosers.col_title.text = Information
label.clientstables.dosers.col_title.filytype = File Type
label.clientstables.dosers.col_title.file = File
label.clientstables.dosers.col_title.filecomments = Description of the file
label.clientstables.dosers.col_title.created = Created
label.field.name = Name
label.button.loadrecord =Find
label.button.allrecord =All
label.button.refresh = Refresh
label.sql.table.label = code to the database 1C
label.activity.label = Directory Business
label.activity.table.label = Table activities
label.activity.table.col_title.name = Activities
label.filesType.label = Reference file types
label.filesType.table.label = Table file types
label.filesType.table.col_title.name = File Type
label.hobbie.label = Directory hobbies
label.hobbie.table.label = Table hobbies
label.hobbie.table.col_title.name = Hobbies
label.segments.label = Directory segments
label.segments.table.label = Table segments
label.segments.table.col_title.name = Segment
label.relatives.label = Directory sibs
label.relatives.table.label = RELATIVES
label.relatives.table.col_title.name = Family relationship
label.contacttypes.label = Directory type contacts
label.contacttypes.table.label = Table type contacts
label.contacttypes.table.col_title.name = Contact Type
label.category.label = Directory categories
label.category.table.label = Table categories
label.category.table.col_title.name = Category name
label.category.table.col_title.subdiv = Division
label.category.table.col_title.subdivs = Division
label.category.table.col_title.subdivname = division title
label.usertables.table.col_title.login = Username
label.usertables.table.col_title.password = Password
label.usertables.table.col_title.fio = full name.
Expand Down Expand Up @@ -209,4 +138,12 @@ label.role.role_id=ROLE IDs
label.role.title=USER ROLEs
label.user.title=SYSTEM USERS
label.user.enabled=ENABLED
label.administrate.roles=User Roles
label.administrate.roles=User Roles
label.documents.table.col_title.counterpart_from=Counterpart from
label.documents.table.col_title.document_type=document type
label.documents.table.col_title.description=Description
label.documents.table.col_title.name=Document name
label.documents.table.col_title.number=Document number
label.documents.table.col_title.counterpart_to=Couterpart TO
label.documents.table.col_title.person_from=Person from
label.documents.table.col_title.person_to=Person to
23 changes: 14 additions & 9 deletions src/main/resources/label_ru_RU.properties
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ label.statistic.area2.label2=Количество досье
label.statistic.area2.label3=Создано новых подразделений
label.statistic.area2.label4=Создано новых категорий
label.statistic.area2.label5=Создано новых типов инфорации
label=Внутренняя база данных клиентов (версия 0.5 бета)
label=Внутренняя база данных ДП "Фаворит-Плюс" (версия 0.1 бета)
label.button.print=Печать
label.dashboard.creteria=Показать последние записи:
label.s403.title=Доступ запрещен
Expand All @@ -216,11 +216,16 @@ label.s403.link=Повторить
label.s404.title=Запрошенной страницы нет
label.s404.message=Запрашиваемая Вами страница не найдена
label.s404.link=К главной
label.emptyrecords=empry records
label.id=ID
label.role.name=ROLE_NAME
label.role.role_id=ROLE IDs
label.role.title=USER ROLEs
label.user.title=SYSTEM USERS
label.user.enabled=ENABLED
label.administrate.roles=User Roles
label.emptyrecords=Нет записей
label.id=ИД
label.role.name=Имя системной роли
label.role.role_id=Идентификатор роли
label.role.title=Права пользователя
label.user.title=Системные пользователи
label.user.enabled=Активный
label.administrate.roles=Права пользователей
label.documents.table.col_title.counterpart_from=От контрагента
label.documents.table.col_title.document_type=Тип документа
label.documents.table.col_title.description=Описание
label.documents.table.col_title.name=Название документа
label.documents.table.col_title.number=Номер документа
7 changes: 6 additions & 1 deletion src/main/resources/label_ua_UA.properties
Original file line number Diff line number Diff line change
Expand Up @@ -223,4 +223,9 @@ label.role.role_id=ROLE IDs
label.role.title=USER ROLEs
label.user.title=SYSTEM USERS
label.user.enabled=ENABLED
label.administrate.roles=User Roles
label.administrate.roles=User Roles
label.documents.table.col_title.counterpart_from=Counterpart from
label.documents.table.col_title.document_type=document type
label.documents.table.col_title.description=Description
label.documents.table.col_title.name=Document name
label.documents.table.col_title.number=Document number
Loading

0 comments on commit ec92c31

Please sign in to comment.