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 7fa7d69 commit c3c9c74
Showing 1 changed file with 43 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
import ua.pp.fairwind.favorid.internalDB.jgrid.JGridRowsResponse;
import ua.pp.fairwind.favorid.internalDB.jgrid.JSComboExpenseResp;
import ua.pp.fairwind.favorid.internalDB.jgrid.Utils;
import ua.pp.fairwind.favorid.internalDB.model.Counterparty;
import ua.pp.fairwind.favorid.internalDB.model.Person;
import ua.pp.fairwind.favorid.internalDB.model.directories.DocumentType;
import ua.pp.fairwind.favorid.internalDB.model.document.Document;
import ua.pp.fairwind.favorid.internalDB.model.proxy.DocumentProxy;
Expand All @@ -32,7 +34,7 @@
import java.util.List;

/**
* Created by Ñåðãåé on 14.10.2015.
* Created by ������ on 14.10.2015.
*/
@Controller
@RequestMapping("/documents")
Expand Down Expand Up @@ -110,6 +112,26 @@ public void editor(@RequestParam String oper,Document document,BindingResult res
DocumentType dt=documentTypeRepository.findOne(typeId);
if(dt!=null)document.setDocumentType(dt);
}
Long from_firm=Utils.getLongParameter("counterprty_from_id",request);
if(from_firm!=null){
Counterparty from=counterpartyRepository.findOne(from_firm);
if(from!=null)document.setCounterparty_from(from);
}
Long to_firm=Utils.getLongParameter("counterprty_to_id",request);
if(to_firm!=null){
Counterparty to=counterpartyRepository.findOne(to_firm);
if(to!=null)document.setCounterparty_to(to);
}
Long from_person=Utils.getLongParameter("person_from_id",request);
if(from_person!=null){
Person from=personRepository.findOne(from_person);
if(from!=null)document.setPerson_from(from);
}
Long to_person=Utils.getLongParameter("person_to_id",request);
if(to_person!=null){
Person to=personRepository.findOne(to_person);
if(to!=null)document.setPerson_to(to);
}
documentRepository.save(document);
response.setStatus(200);
} else {
Expand All @@ -129,6 +151,26 @@ public void editor(@RequestParam String oper,Document document,BindingResult res
DocumentType dt=documentTypeRepository.findOne(typeId);
if(dt!=null)cpt.setDocumentType(dt);
}
Long from_firm=Utils.getLongParameter("counterprty_from_id",request);
if(from_firm!=null){
Counterparty from=counterpartyRepository.findOne(from_firm);
if(from!=null)cpt.setCounterparty_from(from);
}
Long to_firm=Utils.getLongParameter("counterprty_to_id",request);
if(to_firm!=null){
Counterparty to=counterpartyRepository.findOne(to_firm);
if(to!=null)cpt.setCounterparty_to(to);
}
Long from_person=Utils.getLongParameter("person_from_id",request);
if(from_person!=null){
Person from=personRepository.findOne(from_person);
if(from!=null)cpt.setPerson_from(from);
}
Long to_person=Utils.getLongParameter("person_to_id",request);
if(to_person!=null){
Person to=personRepository.findOne(to_person);
if(to!=null)cpt.setPerson_to(to);
}
documentRepository.save(cpt);
response.setStatus(200);
} else {
Expand Down

0 comments on commit c3c9c74

Please sign in to comment.