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 29, 2015
1 parent 684d2d9 commit 4caa62e
Show file tree
Hide file tree
Showing 33 changed files with 318 additions and 83 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,86 @@ public Object simpleClientList(@RequestParam(required = false) Integer page_num,
}
}

@Transactional(readOnly = true)
@RequestMapping(value = "/showCreated", method = RequestMethod.GET)
@ResponseBody
public Object createdList(@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) {
// Retrieve all persons by delegating the call to PersonService
//Sort sort= FormSort.formSortFromSortDescription(orderby);
Sort sort=new Sort(Sort.Direction.ASC,"name");
PageRequest pager=null;
if(page_num!=null && per_page!=null) {
page_num= page_num<1?1:page_num;
pager = new PageRequest(page_num - 1, per_page, sort);
}
if(pager!=null) {
Page<Nomenclature> page;
if (qword != null && qword.length > 0) {
page = nomenclatureRepository.findCreated(qword[0], pager);
} else {
page = nomenclatureRepository.findCreated(pager);
}
return new JSComboExpenseResp<>(page);
} else {
if(pkey!=null && !pkey.isEmpty()){
Long key=Long.valueOf(pkey);
Nomenclature ft=null;
if(key!=null) {
ft = nomenclatureRepository.findOne(key);
}
return ft;
} else {
List<Nomenclature> page;
if (qword != null && qword.length > 0) {
page = nomenclatureRepository.findCreated(qword[0], sort);
} else {
page = nomenclatureRepository.findCreated(sort);
}
return new JSComboExpenseResp<>(page);
}
}
}

@Transactional(readOnly = true)
@RequestMapping(value = "/showArrival", method = RequestMethod.GET)
@ResponseBody
public Object arrivalList(@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) {
// Retrieve all persons by delegating the call to PersonService
//Sort sort= FormSort.formSortFromSortDescription(orderby);
Sort sort=new Sort(Sort.Direction.ASC,"name");
PageRequest pager=null;
if(page_num!=null && per_page!=null) {
page_num= page_num<1?1:page_num;
pager = new PageRequest(page_num - 1, per_page, sort);
}
if(pager!=null) {
Page<Nomenclature> page;
if (qword != null && qword.length > 0) {
page = nomenclatureRepository.findArrival(qword[0], pager);
} else {
page = nomenclatureRepository.findArrival(pager);
}
return new JSComboExpenseResp<>(page);
} else {
if(pkey!=null && !pkey.isEmpty()){
Long key=Long.valueOf(pkey);
Nomenclature ft=null;
if(key!=null) {
ft = nomenclatureRepository.findOne(key);
}
return ft;
} else {
List<Nomenclature> page;
if (qword != null && qword.length > 0) {
page = nomenclatureRepository.findArrival(qword[0], sort);
} else {
page = nomenclatureRepository.findArrival(sort);
}
return new JSComboExpenseResp<>(page);
}
}
}

@Transactional(readOnly = true)
@RequestMapping(value = "/tamplates", method = RequestMethod.POST)
@ResponseBody
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class PositionController {
@Secured("ROLE_USER")
@RequestMapping(value = "/list", method = RequestMethod.GET)
public String list(Model model) {
return "position_list";
return "directoryes/position_list";
}

@Transactional(readOnly = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,31 +52,31 @@ public class RequestController {
@Secured("ROLE_USER")
@RequestMapping(value = "/", method = RequestMethod.GET)
public String list(Model model) {
return "request_list";
return "requests/request_list";
}

@Secured("ROLE_USER")
@RequestMapping(value = "/list_purchase", method = RequestMethod.GET)
public String listPurchase(Model model) {
return "request_list_purchase";
return "requests/request_list_purchase";
}

@Secured("ROLE_USER")
@RequestMapping(value = "/list_shipment", method = RequestMethod.GET)
public String listShipment(Model model) {
return "request_list_shipment";
return "requests/request_list_shipment";
}

@Secured("ROLE_USER")
@RequestMapping(value = "/list_production", method = RequestMethod.GET)
public String listProdaction(Model model) {
return "request_list_prodaction";
return "requests/request_list_prodaction";
}

@Secured("ROLE_USER")
@RequestMapping(value = "/list_repair", method = RequestMethod.GET)
public String listRepair(Model model) {
return "request_list_repair";
return "requests/request_list_repair";
}

@Transactional(readOnly = true)
Expand Down Expand Up @@ -358,7 +358,7 @@ public void editor(@RequestParam String oper,@RequestParam Long id,HttpServletRe
public boolean updateItem(HttpServletRequest req,RequestItems item,Request parent){
UserDetailsAdapter userDetail=(UserDetailsAdapter) SecurityContextHolder.getContext().getAuthentication().getPrincipal();

Long nomenclature_id=Utils.getLongParameter("counterparty_id",req);
Long nomenclature_id=Utils.getLongParameter("nomenclature_id",req);
Long unittype=Utils.getLongParameter("unit",req);
Long count=Utils.getLongParameter("count", req);

Expand Down Expand Up @@ -399,7 +399,7 @@ public void itemEditor(@RequestParam String oper,@RequestParam Long id,@RequestP
case "add": {
RequestItems item = new RequestItems();
updateItem(req, item, request);
requestRepository.save(request);
requestItemRepository.save(item);
requestRepository.save(request);
response.setStatus(200);
}break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class RolesController {
@Secured("ROLE_USER")
@RequestMapping(value = "/list", method = RequestMethod.GET)
public String list(Model model) {
return "role_list";
return "directoryes/role_list";
}

@Transactional(readOnly = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class StorehouseController {
@Secured("ROLE_USER")
@RequestMapping(value = "/list", method = RequestMethod.GET)
public String list(Model model) {
return "storehouse_list";
return "storehouses/storehouse_list";
}

@Transactional(readOnly = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,37 +47,37 @@ public class StorehouseOperation {
@Secured("ROLE_USER")
@RequestMapping(value = "/list", method = RequestMethod.GET)
public String list(Model model) {
return "storehouse_operation_list";
return "storehouses/storehouse_operation_list";
}

@Secured("ROLE_USER")
@RequestMapping(value = "/list_special", method = RequestMethod.GET)
public String list_special(Model model) {
return "storehouse_operation_list_special";
return "storehouses/storehouse_operation_list_special";
}

@Secured("ROLE_USER")
@RequestMapping(value = "/list_arrival", method = RequestMethod.GET)
public String list_arrival(Model model) {
return "storehouse_operation_list_arrival";
return "storehouses/storehouse_operation_list_arrival";
}

@Secured("ROLE_USER")
@RequestMapping(value = "/list_shipment", method = RequestMethod.GET)
public String list_shipment(Model model) {
return "storehouse_operation_list_shipment";
return "storehouses/storehouse_operation_list_shipment";
}

@Secured("ROLE_USER")
@RequestMapping(value = "/list_move", method = RequestMethod.GET)
public String list_move(Model model) {
return "storehouse_operation_list_move";
return "storehouses/storehouse_operation_list_move";
}

@Secured("ROLE_USER")
@RequestMapping(value = "/list_utilization", method = RequestMethod.GET)
public String list_utilization(Model model) {
return "storehouse_operation_list_utilization";
return "storehouses/storehouse_operation_list_utilization";
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class ContactTypeController {
@Secured("ROLE_USER")
@RequestMapping(value = "/list", method = RequestMethod.GET)
public String list(Model model) {
return "contact_type_list";
return "directoryes/contact_type_list";
}

@Transactional(readOnly = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class DocumentTypeController {
@Secured("ROLE_USER")
@RequestMapping(value = "/list", method = RequestMethod.GET)
public String list(Model model) {
return "document_type_list";
return "directoryes/document_type_list";
}

@Transactional(readOnly = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class TaskTypeController {
@Secured("ROLE_USER")
@RequestMapping(value = "/list", method = RequestMethod.GET)
public String list(Model model) {
return "task_type_list";
return "directoryes/task_type_list";
}

@Transactional(readOnly = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public class RequestItems {
Request request;
@ManyToOne
@JoinColumn(name = "nomenclature_ID")
@JsonIgnore
Nomenclature nomenclature;
long count;
Units units;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,31 @@ public interface NomenclatureRepository extends JpaRepository<Nomenclature,Long>
List<Nomenclature> find(@Param(value = "search")String name);
@Query("select n from Nomenclature n where n.code like %:search% or n.name like %:search% or n.country like %:search% or n.manufacturer like %:search%")
List<Nomenclature> find(@Param(value = "search")String name, Sort sort);


@Query("select n from Nomenclature n where n.combined and (n.code like %:search% or n.name like %:search% or n.country like %:search% or n.manufacturer like %:search%)")
Page<Nomenclature> findCreated(@Param(value = "search")String name, Pageable pager);
@Query("select n from Nomenclature n where n.combined and (n.code like %:search% or n.name like %:search% or n.country like %:search% or n.manufacturer like %:search%)")
List<Nomenclature> findCreated(@Param(value = "search")String name);
@Query("select n from Nomenclature n where n.combined and (n.code like %:search% or n.name like %:search% or n.country like %:search% or n.manufacturer like %:search%)")
List<Nomenclature> findCreated(@Param(value = "search")String name, Sort sort);
@Query("select n from Nomenclature n where n.combined")
Page<Nomenclature> findCreated(Pageable pager);
@Query("select n from Nomenclature n where n.combined")
List<Nomenclature> findCreated();
@Query("select n from Nomenclature n where n.combined")
List<Nomenclature> findCreated(Sort sort);

@Query("select n from Nomenclature n where not n.combined and (n.code like %:search% or n.name like %:search% or n.country like %:search% or n.manufacturer like %:search%)")
Page<Nomenclature> findArrival(@Param(value = "search")String name, Pageable pager);
@Query("select n from Nomenclature n where not n.combined and (n.code like %:search% or n.name like %:search% or n.country like %:search% or n.manufacturer like %:search%)")
List<Nomenclature> findArrival(@Param(value = "search")String name);
@Query("select n from Nomenclature n where not n.combined and (n.code like %:search% or n.name like %:search% or n.country like %:search% or n.manufacturer like %:search%)")
List<Nomenclature> findArrival(@Param(value = "search")String name, Sort sort);
@Query("select n from Nomenclature n where not n.combined")
Page<Nomenclature> findArrival(Pageable pager);
@Query("select n from Nomenclature n where not n.combined")
List<Nomenclature> findArrival();
@Query("select n from Nomenclature n where not n.combined")
List<Nomenclature> findArrival(Sort sort);
}
12 changes: 11 additions & 1 deletion src/main/resources/label_en_US.properties
Original file line number Diff line number Diff line change
Expand Up @@ -245,4 +245,14 @@ label.PRODUCTION=REQUEST PRODATION
label.REPAIR=REQUEST REPAIT
label.requests.type=Request Type
label.requests.counterparty=Counerparty
label.requests.agreements=Agreements
label.requests.agreements=Agreements
label.KILOGRAMS=KILOGRAMS
label.GRAMS=GRAMS
label.TONS=TONS
label.COUNT=COUNT
label.LITRES=LITRES
label.MILLILITRES=MILLILITRES
label.METERS=METERS
label.MILLIMETERS=MILLIMETERS
label.requests.nomenclature=Nomenclature
label.requests.items.comments=Comments
68 changes: 39 additions & 29 deletions src/main/resources/label_ru_RU.properties
Original file line number Diff line number Diff line change
Expand Up @@ -206,42 +206,52 @@ label.description=Описание
label.globaldirectory.tasktypes=Типы документов
label.globaldirectory.tasktypes.title=Список типов документов
label.globaldirectory.nomanklature_types=Типы номенклатуры
label.storehouse.operation=Storehouse operations
label.storehouse.operation.title=List of operations in storehouses
label.storehouseoperation.requestNumber=Request Number
label.storehouseoperation.date=Opeartions date
label.storehouseoperation.responsiblePerson=Responsible Person
label.storehouseoperation.source=From Storehouse
label.storehouseoperation.destanation=TO Storehouse
label.storehouseoperation.counterparty=Counterparty
label.storehouseoperation.comments=Comments
label.storehouseoperation.type=Operation Type
label.storehouse.operation=Операции по складу
label.storehouse.operation.title=Список операций по складу
label.storehouseoperation.requestNumber=Номер запроса
label.storehouseoperation.date=Дата
label.storehouseoperation.responsiblePerson=Отвественный
label.storehouseoperation.source=Со склада
label.storehouseoperation.destanation=В склад
label.storehouseoperation.counterparty=Контрагент
label.storehouseoperation.comments=Коментарий
label.storehouseoperation.type=Тип операции
label.storehouse_operation.nomenclature_list=List of nomenclature
label.nomenclature.template.code=Code
label.nomenclature.template.manufactured=Manufacturer
label.nomenclature=Nomenclature
label.nomenclature.manufactured=Manufacturer
label.ARRIVAL=ARRIVAL
label.SHIPMENT=SHIPMENT
label.MOVE=MOVE
label.COMBINED=COMBINED
label.UTILIZATION=UTILIZATION
label.DEFECTIVE=DEFECTIVE
label.storehouse.nomenclature_list=List of nomenclature in storehouse
label.requests=Requests
label.requests.view=Requests
label.requests.operation.production=PRODACTION REQUESTs
label.requests.operation.purchase=PURCHASE REQUETs
label.requests.operation.shipment=SHIPMENT REQUESTs
label.requests.operation.reparir=REPAIR REQUESTs
label.SHIPMENT=ОТГРУЗКА
label.MOVE=ПЕРЕМЕШЕНИЕ
label.COMBINED=ПРОИЗВОДСТВО/КОМПЛЕКТАЦИЯ
label.UTILIZATION=УТИЛИЗАЦИЯ
label.DEFECTIVE=ДЕФЕКТАЦИЯ
label.storehouse.nomenclature_list=Список номенклатуры на складе
label.requests=Запросы
label.requests.view=Запросы
label.requests.operation.production=Запросы на производство
label.requests.operation.purchase=Запросы на закупку
label.requests.operation.shipment=Запросы на отрузку
label.requests.operation.reparir=Запросы на ремонт
label.storehouse.operation.ARRIVAL=ARRIVAL
label.storehouse.operation.SHIPMENT=SHIPMENT
label.storehouse.operation.MOVE=MOVE
label.storehouse.operation.UTILIZATION=UTILIZATION
label.PURCHASE=REQUEST PURCHASE
label.RSHIPMENT=REQUEST SHIPMENT
label.PRODUCTION=REQUEST PRODATION
label.REPAIR=REQUEST REPAIT
label.requests.type=Request Type
label.requests.counterparty=Counerparty
label.requests.agreements=Agreements
label.PURCHASE=ЗАПРОС НА ЗАКУПКУ
label.RSHIPMENT=ЗАПРОС НА ОТГРУЗКУ
label.PRODUCTION=ЗАПРОС НА РОИЗВОДСТВО
label.REPAIR=ЗАПРОС НА РЕМОНТ
label.requests.type=Тип запроса
label.requests.counterparty=Контрагент
label.requests.agreements=Договор
label.KILOGRAMS=KILOGRAMS
label.GRAMS=GRAMS
label.TONS=TONS
label.COUNT=COUNT
label.LITRES=LITRES
label.MILLILITRES=MILLILITRES
label.METERS=METERS
label.MILLIMETERS=MILLIMETERS
label.requests.nomenclature=Nomenclature
label.requests.items.comments=Comments
Loading

0 comments on commit 4caa62e

Please sign in to comment.