提交 42653428 编写于 作者: ibizdev's avatar ibizdev

lab_gzf 发布系统代码

上级 ae844e5c
...@@ -422,5 +422,399 @@ public class Purchase_orderResource { ...@@ -422,5 +422,399 @@ public class Purchase_orderResource {
return ResponseEntity.status(HttpStatus.OK) return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(purchase_orderMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements())); .body(new PageImpl(purchase_orderMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
} }
@PreAuthorize("hasPermission(this.purchase_orderMapping.toDomain(#purchase_orderdto),'iBizBusinessCentral-Purchase_order-Create')")
@ApiOperation(value = "根据联系人建立采购订单", tags = {"采购订单" }, notes = "根据联系人建立采购订单")
@RequestMapping(method = RequestMethod.POST, value = "/res_partners/{res_partner_id}/purchase_orders")
public ResponseEntity<Purchase_orderDTO> createByRes_partner(@PathVariable("res_partner_id") Long res_partner_id, @RequestBody Purchase_orderDTO purchase_orderdto) {
Purchase_order domain = purchase_orderMapping.toDomain(purchase_orderdto);
domain.setPartnerId(res_partner_id);
purchase_orderService.create(domain);
Purchase_orderDTO dto = purchase_orderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.purchase_orderMapping.toDomain(#purchase_orderdtos),'iBizBusinessCentral-Purchase_order-Create')")
@ApiOperation(value = "根据联系人批量建立采购订单", tags = {"采购订单" }, notes = "根据联系人批量建立采购订单")
@RequestMapping(method = RequestMethod.POST, value = "/res_partners/{res_partner_id}/purchase_orders/batch")
public ResponseEntity<Boolean> createBatchByRes_partner(@PathVariable("res_partner_id") Long res_partner_id, @RequestBody List<Purchase_orderDTO> purchase_orderdtos) {
List<Purchase_order> domainlist=purchase_orderMapping.toDomain(purchase_orderdtos);
for(Purchase_order domain:domainlist){
domain.setPartnerId(res_partner_id);
}
purchase_orderService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "purchase_order" , versionfield = "writeDate")
@PreAuthorize("hasPermission(this.purchase_orderService.get(#purchase_order_id),'iBizBusinessCentral-Purchase_order-Update')")
@ApiOperation(value = "根据联系人更新采购订单", tags = {"采购订单" }, notes = "根据联系人更新采购订单")
@RequestMapping(method = RequestMethod.PUT, value = "/res_partners/{res_partner_id}/purchase_orders/{purchase_order_id}")
public ResponseEntity<Purchase_orderDTO> updateByRes_partner(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_order_id") Long purchase_order_id, @RequestBody Purchase_orderDTO purchase_orderdto) {
Purchase_order domain = purchase_orderMapping.toDomain(purchase_orderdto);
domain.setPartnerId(res_partner_id);
domain.setId(purchase_order_id);
purchase_orderService.update(domain);
Purchase_orderDTO dto = purchase_orderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.purchase_orderService.getPurchaseOrderByEntities(this.purchase_orderMapping.toDomain(#purchase_orderdtos)),'iBizBusinessCentral-Purchase_order-Update')")
@ApiOperation(value = "根据联系人批量更新采购订单", tags = {"采购订单" }, notes = "根据联系人批量更新采购订单")
@RequestMapping(method = RequestMethod.PUT, value = "/res_partners/{res_partner_id}/purchase_orders/batch")
public ResponseEntity<Boolean> updateBatchByRes_partner(@PathVariable("res_partner_id") Long res_partner_id, @RequestBody List<Purchase_orderDTO> purchase_orderdtos) {
List<Purchase_order> domainlist=purchase_orderMapping.toDomain(purchase_orderdtos);
for(Purchase_order domain:domainlist){
domain.setPartnerId(res_partner_id);
}
purchase_orderService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.purchase_orderService.get(#purchase_order_id),'iBizBusinessCentral-Purchase_order-Remove')")
@ApiOperation(value = "根据联系人删除采购订单", tags = {"采购订单" }, notes = "根据联系人删除采购订单")
@RequestMapping(method = RequestMethod.DELETE, value = "/res_partners/{res_partner_id}/purchase_orders/{purchase_order_id}")
public ResponseEntity<Boolean> removeByRes_partner(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_order_id") Long purchase_order_id) {
return ResponseEntity.status(HttpStatus.OK).body(purchase_orderService.remove(purchase_order_id));
}
@PreAuthorize("hasPermission(this.purchase_orderService.getPurchaseOrderByIds(#ids),'iBizBusinessCentral-Purchase_order-Remove')")
@ApiOperation(value = "根据联系人批量删除采购订单", tags = {"采购订单" }, notes = "根据联系人批量删除采购订单")
@RequestMapping(method = RequestMethod.DELETE, value = "/res_partners/{res_partner_id}/purchase_orders/batch")
public ResponseEntity<Boolean> removeBatchByRes_partner(@RequestBody List<Long> ids) {
purchase_orderService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.purchase_orderMapping.toDomain(returnObject.body),'iBizBusinessCentral-Purchase_order-Get')")
@ApiOperation(value = "根据联系人获取采购订单", tags = {"采购订单" }, notes = "根据联系人获取采购订单")
@RequestMapping(method = RequestMethod.GET, value = "/res_partners/{res_partner_id}/purchase_orders/{purchase_order_id}")
public ResponseEntity<Purchase_orderDTO> getByRes_partner(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_order_id") Long purchase_order_id) {
Purchase_order domain = purchase_orderService.get(purchase_order_id);
Purchase_orderDTO dto = purchase_orderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据联系人获取采购订单草稿", tags = {"采购订单" }, notes = "根据联系人获取采购订单草稿")
@RequestMapping(method = RequestMethod.GET, value = "/res_partners/{res_partner_id}/purchase_orders/getdraft")
public ResponseEntity<Purchase_orderDTO> getDraftByRes_partner(@PathVariable("res_partner_id") Long res_partner_id) {
Purchase_order domain = new Purchase_order();
domain.setPartnerId(res_partner_id);
return ResponseEntity.status(HttpStatus.OK).body(purchase_orderMapping.toDto(purchase_orderService.getDraft(domain)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_order-Action_view_invoice-all')")
@ApiOperation(value = "根据联系人采购订单", tags = {"采购订单" }, notes = "根据联系人采购订单")
@RequestMapping(method = RequestMethod.POST, value = "/res_partners/{res_partner_id}/purchase_orders/{purchase_order_id}/action_view_invoice")
public ResponseEntity<Purchase_orderDTO> action_view_invoiceByRes_partner(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_order_id") Long purchase_order_id, @RequestBody Purchase_orderDTO purchase_orderdto) {
Purchase_order domain = purchase_orderMapping.toDomain(purchase_orderdto);
domain.setPartnerId(res_partner_id);
domain = purchase_orderService.action_view_invoice(domain) ;
purchase_orderdto = purchase_orderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(purchase_orderdto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_order-Action_view_picking-all')")
@ApiOperation(value = "根据联系人采购订单", tags = {"采购订单" }, notes = "根据联系人采购订单")
@RequestMapping(method = RequestMethod.POST, value = "/res_partners/{res_partner_id}/purchase_orders/{purchase_order_id}/action_view_picking")
public ResponseEntity<Purchase_orderDTO> action_view_pickingByRes_partner(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_order_id") Long purchase_order_id, @RequestBody Purchase_orderDTO purchase_orderdto) {
Purchase_order domain = purchase_orderMapping.toDomain(purchase_orderdto);
domain.setPartnerId(res_partner_id);
domain = purchase_orderService.action_view_picking(domain) ;
purchase_orderdto = purchase_orderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(purchase_orderdto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_order-Button_confirm-all')")
@ApiOperation(value = "根据联系人采购订单", tags = {"采购订单" }, notes = "根据联系人采购订单")
@RequestMapping(method = RequestMethod.POST, value = "/res_partners/{res_partner_id}/purchase_orders/{purchase_order_id}/button_confirm")
public ResponseEntity<Purchase_orderDTO> button_confirmByRes_partner(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_order_id") Long purchase_order_id, @RequestBody Purchase_orderDTO purchase_orderdto) {
Purchase_order domain = purchase_orderMapping.toDomain(purchase_orderdto);
domain.setPartnerId(res_partner_id);
domain = purchase_orderService.button_confirm(domain) ;
purchase_orderdto = purchase_orderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(purchase_orderdto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_order-Button_unlock-all')")
@ApiOperation(value = "根据联系人采购订单", tags = {"采购订单" }, notes = "根据联系人采购订单")
@RequestMapping(method = RequestMethod.POST, value = "/res_partners/{res_partner_id}/purchase_orders/{purchase_order_id}/button_unlock")
public ResponseEntity<Purchase_orderDTO> button_unlockByRes_partner(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_order_id") Long purchase_order_id, @RequestBody Purchase_orderDTO purchase_orderdto) {
Purchase_order domain = purchase_orderMapping.toDomain(purchase_orderdto);
domain.setPartnerId(res_partner_id);
domain = purchase_orderService.button_unlock(domain) ;
purchase_orderdto = purchase_orderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(purchase_orderdto);
}
@ApiOperation(value = "根据联系人检查采购订单", tags = {"采购订单" }, notes = "根据联系人检查采购订单")
@RequestMapping(method = RequestMethod.POST, value = "/res_partners/{res_partner_id}/purchase_orders/checkkey")
public ResponseEntity<Boolean> checkKeyByRes_partner(@PathVariable("res_partner_id") Long res_partner_id, @RequestBody Purchase_orderDTO purchase_orderdto) {
return ResponseEntity.status(HttpStatus.OK).body(purchase_orderService.checkKey(purchase_orderMapping.toDomain(purchase_orderdto)));
}
@PreAuthorize("hasPermission(this.purchase_orderMapping.toDomain(#purchase_orderdto),'iBizBusinessCentral-Purchase_order-Save')")
@ApiOperation(value = "根据联系人保存采购订单", tags = {"采购订单" }, notes = "根据联系人保存采购订单")
@RequestMapping(method = RequestMethod.POST, value = "/res_partners/{res_partner_id}/purchase_orders/save")
public ResponseEntity<Boolean> saveByRes_partner(@PathVariable("res_partner_id") Long res_partner_id, @RequestBody Purchase_orderDTO purchase_orderdto) {
Purchase_order domain = purchase_orderMapping.toDomain(purchase_orderdto);
domain.setPartnerId(res_partner_id);
return ResponseEntity.status(HttpStatus.OK).body(purchase_orderService.save(domain));
}
@PreAuthorize("hasPermission(this.purchase_orderMapping.toDomain(#purchase_orderdtos),'iBizBusinessCentral-Purchase_order-Save')")
@ApiOperation(value = "根据联系人批量保存采购订单", tags = {"采购订单" }, notes = "根据联系人批量保存采购订单")
@RequestMapping(method = RequestMethod.POST, value = "/res_partners/{res_partner_id}/purchase_orders/savebatch")
public ResponseEntity<Boolean> saveBatchByRes_partner(@PathVariable("res_partner_id") Long res_partner_id, @RequestBody List<Purchase_orderDTO> purchase_orderdtos) {
List<Purchase_order> domainlist=purchase_orderMapping.toDomain(purchase_orderdtos);
for(Purchase_order domain:domainlist){
domain.setPartnerId(res_partner_id);
}
purchase_orderService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_order-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-Purchase_order-Get')")
@ApiOperation(value = "根据联系人获取数据集", tags = {"采购订单" } ,notes = "根据联系人获取数据集")
@RequestMapping(method= RequestMethod.GET , value="/res_partners/{res_partner_id}/purchase_orders/fetchdefault")
public ResponseEntity<List<Purchase_orderDTO>> fetchPurchase_orderDefaultByRes_partner(@PathVariable("res_partner_id") Long res_partner_id,Purchase_orderSearchContext context) {
context.setN_partner_id_eq(res_partner_id);
Page<Purchase_order> domains = purchase_orderService.searchDefault(context) ;
List<Purchase_orderDTO> list = purchase_orderMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_order-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-Purchase_order-Get')")
@ApiOperation(value = "根据联系人查询数据集", tags = {"采购订单" } ,notes = "根据联系人查询数据集")
@RequestMapping(method= RequestMethod.POST , value="/res_partners/{res_partner_id}/purchase_orders/searchdefault")
public ResponseEntity<Page<Purchase_orderDTO>> searchPurchase_orderDefaultByRes_partner(@PathVariable("res_partner_id") Long res_partner_id, @RequestBody Purchase_orderSearchContext context) {
context.setN_partner_id_eq(res_partner_id);
Page<Purchase_order> domains = purchase_orderService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(purchase_orderMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_order-searchOrder-all') and hasPermission(#context,'iBizBusinessCentral-Purchase_order-Get')")
@ApiOperation(value = "根据联系人获取订单", tags = {"采购订单" } ,notes = "根据联系人获取订单")
@RequestMapping(method= RequestMethod.GET , value="/res_partners/{res_partner_id}/purchase_orders/fetchorder")
public ResponseEntity<List<Purchase_orderDTO>> fetchPurchase_orderOrderByRes_partner(@PathVariable("res_partner_id") Long res_partner_id,Purchase_orderSearchContext context) {
context.setN_partner_id_eq(res_partner_id);
Page<Purchase_order> domains = purchase_orderService.searchOrder(context) ;
List<Purchase_orderDTO> list = purchase_orderMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_order-searchOrder-all') and hasPermission(#context,'iBizBusinessCentral-Purchase_order-Get')")
@ApiOperation(value = "根据联系人查询订单", tags = {"采购订单" } ,notes = "根据联系人查询订单")
@RequestMapping(method= RequestMethod.POST , value="/res_partners/{res_partner_id}/purchase_orders/searchorder")
public ResponseEntity<Page<Purchase_orderDTO>> searchPurchase_orderOrderByRes_partner(@PathVariable("res_partner_id") Long res_partner_id, @RequestBody Purchase_orderSearchContext context) {
context.setN_partner_id_eq(res_partner_id);
Page<Purchase_order> domains = purchase_orderService.searchOrder(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(purchase_orderMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.purchase_orderMapping.toDomain(#purchase_orderdto),'iBizBusinessCentral-Purchase_order-Create')")
@ApiOperation(value = "根据联系人采购申请建立采购订单", tags = {"采购订单" }, notes = "根据联系人采购申请建立采购订单")
@RequestMapping(method = RequestMethod.POST, value = "/res_partners/{res_partner_id}/purchase_requisitions/{purchase_requisition_id}/purchase_orders")
public ResponseEntity<Purchase_orderDTO> createByRes_partnerPurchase_requisition(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_requisition_id") Long purchase_requisition_id, @RequestBody Purchase_orderDTO purchase_orderdto) {
Purchase_order domain = purchase_orderMapping.toDomain(purchase_orderdto);
domain.setRequisitionId(purchase_requisition_id);
purchase_orderService.create(domain);
Purchase_orderDTO dto = purchase_orderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.purchase_orderMapping.toDomain(#purchase_orderdtos),'iBizBusinessCentral-Purchase_order-Create')")
@ApiOperation(value = "根据联系人采购申请批量建立采购订单", tags = {"采购订单" }, notes = "根据联系人采购申请批量建立采购订单")
@RequestMapping(method = RequestMethod.POST, value = "/res_partners/{res_partner_id}/purchase_requisitions/{purchase_requisition_id}/purchase_orders/batch")
public ResponseEntity<Boolean> createBatchByRes_partnerPurchase_requisition(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_requisition_id") Long purchase_requisition_id, @RequestBody List<Purchase_orderDTO> purchase_orderdtos) {
List<Purchase_order> domainlist=purchase_orderMapping.toDomain(purchase_orderdtos);
for(Purchase_order domain:domainlist){
domain.setRequisitionId(purchase_requisition_id);
}
purchase_orderService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "purchase_order" , versionfield = "writeDate")
@PreAuthorize("hasPermission(this.purchase_orderService.get(#purchase_order_id),'iBizBusinessCentral-Purchase_order-Update')")
@ApiOperation(value = "根据联系人采购申请更新采购订单", tags = {"采购订单" }, notes = "根据联系人采购申请更新采购订单")
@RequestMapping(method = RequestMethod.PUT, value = "/res_partners/{res_partner_id}/purchase_requisitions/{purchase_requisition_id}/purchase_orders/{purchase_order_id}")
public ResponseEntity<Purchase_orderDTO> updateByRes_partnerPurchase_requisition(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_requisition_id") Long purchase_requisition_id, @PathVariable("purchase_order_id") Long purchase_order_id, @RequestBody Purchase_orderDTO purchase_orderdto) {
Purchase_order domain = purchase_orderMapping.toDomain(purchase_orderdto);
domain.setRequisitionId(purchase_requisition_id);
domain.setId(purchase_order_id);
purchase_orderService.update(domain);
Purchase_orderDTO dto = purchase_orderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.purchase_orderService.getPurchaseOrderByEntities(this.purchase_orderMapping.toDomain(#purchase_orderdtos)),'iBizBusinessCentral-Purchase_order-Update')")
@ApiOperation(value = "根据联系人采购申请批量更新采购订单", tags = {"采购订单" }, notes = "根据联系人采购申请批量更新采购订单")
@RequestMapping(method = RequestMethod.PUT, value = "/res_partners/{res_partner_id}/purchase_requisitions/{purchase_requisition_id}/purchase_orders/batch")
public ResponseEntity<Boolean> updateBatchByRes_partnerPurchase_requisition(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_requisition_id") Long purchase_requisition_id, @RequestBody List<Purchase_orderDTO> purchase_orderdtos) {
List<Purchase_order> domainlist=purchase_orderMapping.toDomain(purchase_orderdtos);
for(Purchase_order domain:domainlist){
domain.setRequisitionId(purchase_requisition_id);
}
purchase_orderService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.purchase_orderService.get(#purchase_order_id),'iBizBusinessCentral-Purchase_order-Remove')")
@ApiOperation(value = "根据联系人采购申请删除采购订单", tags = {"采购订单" }, notes = "根据联系人采购申请删除采购订单")
@RequestMapping(method = RequestMethod.DELETE, value = "/res_partners/{res_partner_id}/purchase_requisitions/{purchase_requisition_id}/purchase_orders/{purchase_order_id}")
public ResponseEntity<Boolean> removeByRes_partnerPurchase_requisition(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_requisition_id") Long purchase_requisition_id, @PathVariable("purchase_order_id") Long purchase_order_id) {
return ResponseEntity.status(HttpStatus.OK).body(purchase_orderService.remove(purchase_order_id));
}
@PreAuthorize("hasPermission(this.purchase_orderService.getPurchaseOrderByIds(#ids),'iBizBusinessCentral-Purchase_order-Remove')")
@ApiOperation(value = "根据联系人采购申请批量删除采购订单", tags = {"采购订单" }, notes = "根据联系人采购申请批量删除采购订单")
@RequestMapping(method = RequestMethod.DELETE, value = "/res_partners/{res_partner_id}/purchase_requisitions/{purchase_requisition_id}/purchase_orders/batch")
public ResponseEntity<Boolean> removeBatchByRes_partnerPurchase_requisition(@RequestBody List<Long> ids) {
purchase_orderService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.purchase_orderMapping.toDomain(returnObject.body),'iBizBusinessCentral-Purchase_order-Get')")
@ApiOperation(value = "根据联系人采购申请获取采购订单", tags = {"采购订单" }, notes = "根据联系人采购申请获取采购订单")
@RequestMapping(method = RequestMethod.GET, value = "/res_partners/{res_partner_id}/purchase_requisitions/{purchase_requisition_id}/purchase_orders/{purchase_order_id}")
public ResponseEntity<Purchase_orderDTO> getByRes_partnerPurchase_requisition(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_requisition_id") Long purchase_requisition_id, @PathVariable("purchase_order_id") Long purchase_order_id) {
Purchase_order domain = purchase_orderService.get(purchase_order_id);
Purchase_orderDTO dto = purchase_orderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据联系人采购申请获取采购订单草稿", tags = {"采购订单" }, notes = "根据联系人采购申请获取采购订单草稿")
@RequestMapping(method = RequestMethod.GET, value = "/res_partners/{res_partner_id}/purchase_requisitions/{purchase_requisition_id}/purchase_orders/getdraft")
public ResponseEntity<Purchase_orderDTO> getDraftByRes_partnerPurchase_requisition(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_requisition_id") Long purchase_requisition_id) {
Purchase_order domain = new Purchase_order();
domain.setRequisitionId(purchase_requisition_id);
return ResponseEntity.status(HttpStatus.OK).body(purchase_orderMapping.toDto(purchase_orderService.getDraft(domain)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_order-Action_view_invoice-all')")
@ApiOperation(value = "根据联系人采购申请采购订单", tags = {"采购订单" }, notes = "根据联系人采购申请采购订单")
@RequestMapping(method = RequestMethod.POST, value = "/res_partners/{res_partner_id}/purchase_requisitions/{purchase_requisition_id}/purchase_orders/{purchase_order_id}/action_view_invoice")
public ResponseEntity<Purchase_orderDTO> action_view_invoiceByRes_partnerPurchase_requisition(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_requisition_id") Long purchase_requisition_id, @PathVariable("purchase_order_id") Long purchase_order_id, @RequestBody Purchase_orderDTO purchase_orderdto) {
Purchase_order domain = purchase_orderMapping.toDomain(purchase_orderdto);
domain.setRequisitionId(purchase_requisition_id);
domain = purchase_orderService.action_view_invoice(domain) ;
purchase_orderdto = purchase_orderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(purchase_orderdto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_order-Action_view_picking-all')")
@ApiOperation(value = "根据联系人采购申请采购订单", tags = {"采购订单" }, notes = "根据联系人采购申请采购订单")
@RequestMapping(method = RequestMethod.POST, value = "/res_partners/{res_partner_id}/purchase_requisitions/{purchase_requisition_id}/purchase_orders/{purchase_order_id}/action_view_picking")
public ResponseEntity<Purchase_orderDTO> action_view_pickingByRes_partnerPurchase_requisition(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_requisition_id") Long purchase_requisition_id, @PathVariable("purchase_order_id") Long purchase_order_id, @RequestBody Purchase_orderDTO purchase_orderdto) {
Purchase_order domain = purchase_orderMapping.toDomain(purchase_orderdto);
domain.setRequisitionId(purchase_requisition_id);
domain = purchase_orderService.action_view_picking(domain) ;
purchase_orderdto = purchase_orderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(purchase_orderdto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_order-Button_confirm-all')")
@ApiOperation(value = "根据联系人采购申请采购订单", tags = {"采购订单" }, notes = "根据联系人采购申请采购订单")
@RequestMapping(method = RequestMethod.POST, value = "/res_partners/{res_partner_id}/purchase_requisitions/{purchase_requisition_id}/purchase_orders/{purchase_order_id}/button_confirm")
public ResponseEntity<Purchase_orderDTO> button_confirmByRes_partnerPurchase_requisition(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_requisition_id") Long purchase_requisition_id, @PathVariable("purchase_order_id") Long purchase_order_id, @RequestBody Purchase_orderDTO purchase_orderdto) {
Purchase_order domain = purchase_orderMapping.toDomain(purchase_orderdto);
domain.setRequisitionId(purchase_requisition_id);
domain = purchase_orderService.button_confirm(domain) ;
purchase_orderdto = purchase_orderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(purchase_orderdto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_order-Button_unlock-all')")
@ApiOperation(value = "根据联系人采购申请采购订单", tags = {"采购订单" }, notes = "根据联系人采购申请采购订单")
@RequestMapping(method = RequestMethod.POST, value = "/res_partners/{res_partner_id}/purchase_requisitions/{purchase_requisition_id}/purchase_orders/{purchase_order_id}/button_unlock")
public ResponseEntity<Purchase_orderDTO> button_unlockByRes_partnerPurchase_requisition(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_requisition_id") Long purchase_requisition_id, @PathVariable("purchase_order_id") Long purchase_order_id, @RequestBody Purchase_orderDTO purchase_orderdto) {
Purchase_order domain = purchase_orderMapping.toDomain(purchase_orderdto);
domain.setRequisitionId(purchase_requisition_id);
domain = purchase_orderService.button_unlock(domain) ;
purchase_orderdto = purchase_orderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(purchase_orderdto);
}
@ApiOperation(value = "根据联系人采购申请检查采购订单", tags = {"采购订单" }, notes = "根据联系人采购申请检查采购订单")
@RequestMapping(method = RequestMethod.POST, value = "/res_partners/{res_partner_id}/purchase_requisitions/{purchase_requisition_id}/purchase_orders/checkkey")
public ResponseEntity<Boolean> checkKeyByRes_partnerPurchase_requisition(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_requisition_id") Long purchase_requisition_id, @RequestBody Purchase_orderDTO purchase_orderdto) {
return ResponseEntity.status(HttpStatus.OK).body(purchase_orderService.checkKey(purchase_orderMapping.toDomain(purchase_orderdto)));
}
@PreAuthorize("hasPermission(this.purchase_orderMapping.toDomain(#purchase_orderdto),'iBizBusinessCentral-Purchase_order-Save')")
@ApiOperation(value = "根据联系人采购申请保存采购订单", tags = {"采购订单" }, notes = "根据联系人采购申请保存采购订单")
@RequestMapping(method = RequestMethod.POST, value = "/res_partners/{res_partner_id}/purchase_requisitions/{purchase_requisition_id}/purchase_orders/save")
public ResponseEntity<Boolean> saveByRes_partnerPurchase_requisition(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_requisition_id") Long purchase_requisition_id, @RequestBody Purchase_orderDTO purchase_orderdto) {
Purchase_order domain = purchase_orderMapping.toDomain(purchase_orderdto);
domain.setRequisitionId(purchase_requisition_id);
return ResponseEntity.status(HttpStatus.OK).body(purchase_orderService.save(domain));
}
@PreAuthorize("hasPermission(this.purchase_orderMapping.toDomain(#purchase_orderdtos),'iBizBusinessCentral-Purchase_order-Save')")
@ApiOperation(value = "根据联系人采购申请批量保存采购订单", tags = {"采购订单" }, notes = "根据联系人采购申请批量保存采购订单")
@RequestMapping(method = RequestMethod.POST, value = "/res_partners/{res_partner_id}/purchase_requisitions/{purchase_requisition_id}/purchase_orders/savebatch")
public ResponseEntity<Boolean> saveBatchByRes_partnerPurchase_requisition(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_requisition_id") Long purchase_requisition_id, @RequestBody List<Purchase_orderDTO> purchase_orderdtos) {
List<Purchase_order> domainlist=purchase_orderMapping.toDomain(purchase_orderdtos);
for(Purchase_order domain:domainlist){
domain.setRequisitionId(purchase_requisition_id);
}
purchase_orderService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_order-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-Purchase_order-Get')")
@ApiOperation(value = "根据联系人采购申请获取数据集", tags = {"采购订单" } ,notes = "根据联系人采购申请获取数据集")
@RequestMapping(method= RequestMethod.GET , value="/res_partners/{res_partner_id}/purchase_requisitions/{purchase_requisition_id}/purchase_orders/fetchdefault")
public ResponseEntity<List<Purchase_orderDTO>> fetchPurchase_orderDefaultByRes_partnerPurchase_requisition(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_requisition_id") Long purchase_requisition_id,Purchase_orderSearchContext context) {
context.setN_requisition_id_eq(purchase_requisition_id);
Page<Purchase_order> domains = purchase_orderService.searchDefault(context) ;
List<Purchase_orderDTO> list = purchase_orderMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_order-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-Purchase_order-Get')")
@ApiOperation(value = "根据联系人采购申请查询数据集", tags = {"采购订单" } ,notes = "根据联系人采购申请查询数据集")
@RequestMapping(method= RequestMethod.POST , value="/res_partners/{res_partner_id}/purchase_requisitions/{purchase_requisition_id}/purchase_orders/searchdefault")
public ResponseEntity<Page<Purchase_orderDTO>> searchPurchase_orderDefaultByRes_partnerPurchase_requisition(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_requisition_id") Long purchase_requisition_id, @RequestBody Purchase_orderSearchContext context) {
context.setN_requisition_id_eq(purchase_requisition_id);
Page<Purchase_order> domains = purchase_orderService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(purchase_orderMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_order-searchOrder-all') and hasPermission(#context,'iBizBusinessCentral-Purchase_order-Get')")
@ApiOperation(value = "根据联系人采购申请获取订单", tags = {"采购订单" } ,notes = "根据联系人采购申请获取订单")
@RequestMapping(method= RequestMethod.GET , value="/res_partners/{res_partner_id}/purchase_requisitions/{purchase_requisition_id}/purchase_orders/fetchorder")
public ResponseEntity<List<Purchase_orderDTO>> fetchPurchase_orderOrderByRes_partnerPurchase_requisition(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_requisition_id") Long purchase_requisition_id,Purchase_orderSearchContext context) {
context.setN_requisition_id_eq(purchase_requisition_id);
Page<Purchase_order> domains = purchase_orderService.searchOrder(context) ;
List<Purchase_orderDTO> list = purchase_orderMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_order-searchOrder-all') and hasPermission(#context,'iBizBusinessCentral-Purchase_order-Get')")
@ApiOperation(value = "根据联系人采购申请查询订单", tags = {"采购订单" } ,notes = "根据联系人采购申请查询订单")
@RequestMapping(method= RequestMethod.POST , value="/res_partners/{res_partner_id}/purchase_requisitions/{purchase_requisition_id}/purchase_orders/searchorder")
public ResponseEntity<Page<Purchase_orderDTO>> searchPurchase_orderOrderByRes_partnerPurchase_requisition(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_requisition_id") Long purchase_requisition_id, @RequestBody Purchase_orderSearchContext context) {
context.setN_requisition_id_eq(purchase_requisition_id);
Page<Purchase_order> domains = purchase_orderService.searchOrder(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(purchase_orderMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
} }
...@@ -419,5 +419,265 @@ public class Purchase_order_lineResource { ...@@ -419,5 +419,265 @@ public class Purchase_order_lineResource {
return ResponseEntity.status(HttpStatus.OK) return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(purchase_order_lineMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements())); .body(new PageImpl(purchase_order_lineMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
} }
@PreAuthorize("hasPermission(this.purchase_order_lineMapping.toDomain(#purchase_order_linedto),'iBizBusinessCentral-Purchase_order_line-Create')")
@ApiOperation(value = "根据联系人采购订单建立采购订单行", tags = {"采购订单行" }, notes = "根据联系人采购订单建立采购订单行")
@RequestMapping(method = RequestMethod.POST, value = "/res_partners/{res_partner_id}/purchase_orders/{purchase_order_id}/purchase_order_lines")
public ResponseEntity<Purchase_order_lineDTO> createByRes_partnerPurchase_order(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_order_id") Long purchase_order_id, @RequestBody Purchase_order_lineDTO purchase_order_linedto) {
Purchase_order_line domain = purchase_order_lineMapping.toDomain(purchase_order_linedto);
domain.setOrderId(purchase_order_id);
purchase_order_lineService.create(domain);
Purchase_order_lineDTO dto = purchase_order_lineMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.purchase_order_lineMapping.toDomain(#purchase_order_linedtos),'iBizBusinessCentral-Purchase_order_line-Create')")
@ApiOperation(value = "根据联系人采购订单批量建立采购订单行", tags = {"采购订单行" }, notes = "根据联系人采购订单批量建立采购订单行")
@RequestMapping(method = RequestMethod.POST, value = "/res_partners/{res_partner_id}/purchase_orders/{purchase_order_id}/purchase_order_lines/batch")
public ResponseEntity<Boolean> createBatchByRes_partnerPurchase_order(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_order_id") Long purchase_order_id, @RequestBody List<Purchase_order_lineDTO> purchase_order_linedtos) {
List<Purchase_order_line> domainlist=purchase_order_lineMapping.toDomain(purchase_order_linedtos);
for(Purchase_order_line domain:domainlist){
domain.setOrderId(purchase_order_id);
}
purchase_order_lineService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "purchase_order_line" , versionfield = "writeDate")
@PreAuthorize("hasPermission(this.purchase_order_lineService.get(#purchase_order_line_id),'iBizBusinessCentral-Purchase_order_line-Update')")
@ApiOperation(value = "根据联系人采购订单更新采购订单行", tags = {"采购订单行" }, notes = "根据联系人采购订单更新采购订单行")
@RequestMapping(method = RequestMethod.PUT, value = "/res_partners/{res_partner_id}/purchase_orders/{purchase_order_id}/purchase_order_lines/{purchase_order_line_id}")
public ResponseEntity<Purchase_order_lineDTO> updateByRes_partnerPurchase_order(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_order_id") Long purchase_order_id, @PathVariable("purchase_order_line_id") Long purchase_order_line_id, @RequestBody Purchase_order_lineDTO purchase_order_linedto) {
Purchase_order_line domain = purchase_order_lineMapping.toDomain(purchase_order_linedto);
domain.setOrderId(purchase_order_id);
domain.setId(purchase_order_line_id);
purchase_order_lineService.update(domain);
Purchase_order_lineDTO dto = purchase_order_lineMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.purchase_order_lineService.getPurchaseOrderLineByEntities(this.purchase_order_lineMapping.toDomain(#purchase_order_linedtos)),'iBizBusinessCentral-Purchase_order_line-Update')")
@ApiOperation(value = "根据联系人采购订单批量更新采购订单行", tags = {"采购订单行" }, notes = "根据联系人采购订单批量更新采购订单行")
@RequestMapping(method = RequestMethod.PUT, value = "/res_partners/{res_partner_id}/purchase_orders/{purchase_order_id}/purchase_order_lines/batch")
public ResponseEntity<Boolean> updateBatchByRes_partnerPurchase_order(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_order_id") Long purchase_order_id, @RequestBody List<Purchase_order_lineDTO> purchase_order_linedtos) {
List<Purchase_order_line> domainlist=purchase_order_lineMapping.toDomain(purchase_order_linedtos);
for(Purchase_order_line domain:domainlist){
domain.setOrderId(purchase_order_id);
}
purchase_order_lineService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.purchase_order_lineService.get(#purchase_order_line_id),'iBizBusinessCentral-Purchase_order_line-Remove')")
@ApiOperation(value = "根据联系人采购订单删除采购订单行", tags = {"采购订单行" }, notes = "根据联系人采购订单删除采购订单行")
@RequestMapping(method = RequestMethod.DELETE, value = "/res_partners/{res_partner_id}/purchase_orders/{purchase_order_id}/purchase_order_lines/{purchase_order_line_id}")
public ResponseEntity<Boolean> removeByRes_partnerPurchase_order(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_order_id") Long purchase_order_id, @PathVariable("purchase_order_line_id") Long purchase_order_line_id) {
return ResponseEntity.status(HttpStatus.OK).body(purchase_order_lineService.remove(purchase_order_line_id));
}
@PreAuthorize("hasPermission(this.purchase_order_lineService.getPurchaseOrderLineByIds(#ids),'iBizBusinessCentral-Purchase_order_line-Remove')")
@ApiOperation(value = "根据联系人采购订单批量删除采购订单行", tags = {"采购订单行" }, notes = "根据联系人采购订单批量删除采购订单行")
@RequestMapping(method = RequestMethod.DELETE, value = "/res_partners/{res_partner_id}/purchase_orders/{purchase_order_id}/purchase_order_lines/batch")
public ResponseEntity<Boolean> removeBatchByRes_partnerPurchase_order(@RequestBody List<Long> ids) {
purchase_order_lineService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.purchase_order_lineMapping.toDomain(returnObject.body),'iBizBusinessCentral-Purchase_order_line-Get')")
@ApiOperation(value = "根据联系人采购订单获取采购订单行", tags = {"采购订单行" }, notes = "根据联系人采购订单获取采购订单行")
@RequestMapping(method = RequestMethod.GET, value = "/res_partners/{res_partner_id}/purchase_orders/{purchase_order_id}/purchase_order_lines/{purchase_order_line_id}")
public ResponseEntity<Purchase_order_lineDTO> getByRes_partnerPurchase_order(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_order_id") Long purchase_order_id, @PathVariable("purchase_order_line_id") Long purchase_order_line_id) {
Purchase_order_line domain = purchase_order_lineService.get(purchase_order_line_id);
Purchase_order_lineDTO dto = purchase_order_lineMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据联系人采购订单获取采购订单行草稿", tags = {"采购订单行" }, notes = "根据联系人采购订单获取采购订单行草稿")
@RequestMapping(method = RequestMethod.GET, value = "/res_partners/{res_partner_id}/purchase_orders/{purchase_order_id}/purchase_order_lines/getdraft")
public ResponseEntity<Purchase_order_lineDTO> getDraftByRes_partnerPurchase_order(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_order_id") Long purchase_order_id) {
Purchase_order_line domain = new Purchase_order_line();
domain.setOrderId(purchase_order_id);
return ResponseEntity.status(HttpStatus.OK).body(purchase_order_lineMapping.toDto(purchase_order_lineService.getDraft(domain)));
}
@ApiOperation(value = "根据联系人采购订单检查采购订单行", tags = {"采购订单行" }, notes = "根据联系人采购订单检查采购订单行")
@RequestMapping(method = RequestMethod.POST, value = "/res_partners/{res_partner_id}/purchase_orders/{purchase_order_id}/purchase_order_lines/checkkey")
public ResponseEntity<Boolean> checkKeyByRes_partnerPurchase_order(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_order_id") Long purchase_order_id, @RequestBody Purchase_order_lineDTO purchase_order_linedto) {
return ResponseEntity.status(HttpStatus.OK).body(purchase_order_lineService.checkKey(purchase_order_lineMapping.toDomain(purchase_order_linedto)));
}
@PreAuthorize("hasPermission(this.purchase_order_lineMapping.toDomain(#purchase_order_linedto),'iBizBusinessCentral-Purchase_order_line-Save')")
@ApiOperation(value = "根据联系人采购订单保存采购订单行", tags = {"采购订单行" }, notes = "根据联系人采购订单保存采购订单行")
@RequestMapping(method = RequestMethod.POST, value = "/res_partners/{res_partner_id}/purchase_orders/{purchase_order_id}/purchase_order_lines/save")
public ResponseEntity<Boolean> saveByRes_partnerPurchase_order(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_order_id") Long purchase_order_id, @RequestBody Purchase_order_lineDTO purchase_order_linedto) {
Purchase_order_line domain = purchase_order_lineMapping.toDomain(purchase_order_linedto);
domain.setOrderId(purchase_order_id);
return ResponseEntity.status(HttpStatus.OK).body(purchase_order_lineService.save(domain));
}
@PreAuthorize("hasPermission(this.purchase_order_lineMapping.toDomain(#purchase_order_linedtos),'iBizBusinessCentral-Purchase_order_line-Save')")
@ApiOperation(value = "根据联系人采购订单批量保存采购订单行", tags = {"采购订单行" }, notes = "根据联系人采购订单批量保存采购订单行")
@RequestMapping(method = RequestMethod.POST, value = "/res_partners/{res_partner_id}/purchase_orders/{purchase_order_id}/purchase_order_lines/savebatch")
public ResponseEntity<Boolean> saveBatchByRes_partnerPurchase_order(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_order_id") Long purchase_order_id, @RequestBody List<Purchase_order_lineDTO> purchase_order_linedtos) {
List<Purchase_order_line> domainlist=purchase_order_lineMapping.toDomain(purchase_order_linedtos);
for(Purchase_order_line domain:domainlist){
domain.setOrderId(purchase_order_id);
}
purchase_order_lineService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_order_line-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-Purchase_order_line-Get')")
@ApiOperation(value = "根据联系人采购订单获取数据集", tags = {"采购订单行" } ,notes = "根据联系人采购订单获取数据集")
@RequestMapping(method= RequestMethod.GET , value="/res_partners/{res_partner_id}/purchase_orders/{purchase_order_id}/purchase_order_lines/fetchdefault")
public ResponseEntity<List<Purchase_order_lineDTO>> fetchPurchase_order_lineDefaultByRes_partnerPurchase_order(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_order_id") Long purchase_order_id,Purchase_order_lineSearchContext context) {
context.setN_order_id_eq(purchase_order_id);
Page<Purchase_order_line> domains = purchase_order_lineService.searchDefault(context) ;
List<Purchase_order_lineDTO> list = purchase_order_lineMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_order_line-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-Purchase_order_line-Get')")
@ApiOperation(value = "根据联系人采购订单查询数据集", tags = {"采购订单行" } ,notes = "根据联系人采购订单查询数据集")
@RequestMapping(method= RequestMethod.POST , value="/res_partners/{res_partner_id}/purchase_orders/{purchase_order_id}/purchase_order_lines/searchdefault")
public ResponseEntity<Page<Purchase_order_lineDTO>> searchPurchase_order_lineDefaultByRes_partnerPurchase_order(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_order_id") Long purchase_order_id, @RequestBody Purchase_order_lineSearchContext context) {
context.setN_order_id_eq(purchase_order_id);
Page<Purchase_order_line> domains = purchase_order_lineService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(purchase_order_lineMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.purchase_order_lineMapping.toDomain(#purchase_order_linedto),'iBizBusinessCentral-Purchase_order_line-Create')")
@ApiOperation(value = "根据联系人采购申请采购订单建立采购订单行", tags = {"采购订单行" }, notes = "根据联系人采购申请采购订单建立采购订单行")
@RequestMapping(method = RequestMethod.POST, value = "/res_partners/{res_partner_id}/purchase_requisitions/{purchase_requisition_id}/purchase_orders/{purchase_order_id}/purchase_order_lines")
public ResponseEntity<Purchase_order_lineDTO> createByRes_partnerPurchase_requisitionPurchase_order(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_requisition_id") Long purchase_requisition_id, @PathVariable("purchase_order_id") Long purchase_order_id, @RequestBody Purchase_order_lineDTO purchase_order_linedto) {
Purchase_order_line domain = purchase_order_lineMapping.toDomain(purchase_order_linedto);
domain.setOrderId(purchase_order_id);
purchase_order_lineService.create(domain);
Purchase_order_lineDTO dto = purchase_order_lineMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.purchase_order_lineMapping.toDomain(#purchase_order_linedtos),'iBizBusinessCentral-Purchase_order_line-Create')")
@ApiOperation(value = "根据联系人采购申请采购订单批量建立采购订单行", tags = {"采购订单行" }, notes = "根据联系人采购申请采购订单批量建立采购订单行")
@RequestMapping(method = RequestMethod.POST, value = "/res_partners/{res_partner_id}/purchase_requisitions/{purchase_requisition_id}/purchase_orders/{purchase_order_id}/purchase_order_lines/batch")
public ResponseEntity<Boolean> createBatchByRes_partnerPurchase_requisitionPurchase_order(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_requisition_id") Long purchase_requisition_id, @PathVariable("purchase_order_id") Long purchase_order_id, @RequestBody List<Purchase_order_lineDTO> purchase_order_linedtos) {
List<Purchase_order_line> domainlist=purchase_order_lineMapping.toDomain(purchase_order_linedtos);
for(Purchase_order_line domain:domainlist){
domain.setOrderId(purchase_order_id);
}
purchase_order_lineService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "purchase_order_line" , versionfield = "writeDate")
@PreAuthorize("hasPermission(this.purchase_order_lineService.get(#purchase_order_line_id),'iBizBusinessCentral-Purchase_order_line-Update')")
@ApiOperation(value = "根据联系人采购申请采购订单更新采购订单行", tags = {"采购订单行" }, notes = "根据联系人采购申请采购订单更新采购订单行")
@RequestMapping(method = RequestMethod.PUT, value = "/res_partners/{res_partner_id}/purchase_requisitions/{purchase_requisition_id}/purchase_orders/{purchase_order_id}/purchase_order_lines/{purchase_order_line_id}")
public ResponseEntity<Purchase_order_lineDTO> updateByRes_partnerPurchase_requisitionPurchase_order(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_requisition_id") Long purchase_requisition_id, @PathVariable("purchase_order_id") Long purchase_order_id, @PathVariable("purchase_order_line_id") Long purchase_order_line_id, @RequestBody Purchase_order_lineDTO purchase_order_linedto) {
Purchase_order_line domain = purchase_order_lineMapping.toDomain(purchase_order_linedto);
domain.setOrderId(purchase_order_id);
domain.setId(purchase_order_line_id);
purchase_order_lineService.update(domain);
Purchase_order_lineDTO dto = purchase_order_lineMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.purchase_order_lineService.getPurchaseOrderLineByEntities(this.purchase_order_lineMapping.toDomain(#purchase_order_linedtos)),'iBizBusinessCentral-Purchase_order_line-Update')")
@ApiOperation(value = "根据联系人采购申请采购订单批量更新采购订单行", tags = {"采购订单行" }, notes = "根据联系人采购申请采购订单批量更新采购订单行")
@RequestMapping(method = RequestMethod.PUT, value = "/res_partners/{res_partner_id}/purchase_requisitions/{purchase_requisition_id}/purchase_orders/{purchase_order_id}/purchase_order_lines/batch")
public ResponseEntity<Boolean> updateBatchByRes_partnerPurchase_requisitionPurchase_order(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_requisition_id") Long purchase_requisition_id, @PathVariable("purchase_order_id") Long purchase_order_id, @RequestBody List<Purchase_order_lineDTO> purchase_order_linedtos) {
List<Purchase_order_line> domainlist=purchase_order_lineMapping.toDomain(purchase_order_linedtos);
for(Purchase_order_line domain:domainlist){
domain.setOrderId(purchase_order_id);
}
purchase_order_lineService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.purchase_order_lineService.get(#purchase_order_line_id),'iBizBusinessCentral-Purchase_order_line-Remove')")
@ApiOperation(value = "根据联系人采购申请采购订单删除采购订单行", tags = {"采购订单行" }, notes = "根据联系人采购申请采购订单删除采购订单行")
@RequestMapping(method = RequestMethod.DELETE, value = "/res_partners/{res_partner_id}/purchase_requisitions/{purchase_requisition_id}/purchase_orders/{purchase_order_id}/purchase_order_lines/{purchase_order_line_id}")
public ResponseEntity<Boolean> removeByRes_partnerPurchase_requisitionPurchase_order(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_requisition_id") Long purchase_requisition_id, @PathVariable("purchase_order_id") Long purchase_order_id, @PathVariable("purchase_order_line_id") Long purchase_order_line_id) {
return ResponseEntity.status(HttpStatus.OK).body(purchase_order_lineService.remove(purchase_order_line_id));
}
@PreAuthorize("hasPermission(this.purchase_order_lineService.getPurchaseOrderLineByIds(#ids),'iBizBusinessCentral-Purchase_order_line-Remove')")
@ApiOperation(value = "根据联系人采购申请采购订单批量删除采购订单行", tags = {"采购订单行" }, notes = "根据联系人采购申请采购订单批量删除采购订单行")
@RequestMapping(method = RequestMethod.DELETE, value = "/res_partners/{res_partner_id}/purchase_requisitions/{purchase_requisition_id}/purchase_orders/{purchase_order_id}/purchase_order_lines/batch")
public ResponseEntity<Boolean> removeBatchByRes_partnerPurchase_requisitionPurchase_order(@RequestBody List<Long> ids) {
purchase_order_lineService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.purchase_order_lineMapping.toDomain(returnObject.body),'iBizBusinessCentral-Purchase_order_line-Get')")
@ApiOperation(value = "根据联系人采购申请采购订单获取采购订单行", tags = {"采购订单行" }, notes = "根据联系人采购申请采购订单获取采购订单行")
@RequestMapping(method = RequestMethod.GET, value = "/res_partners/{res_partner_id}/purchase_requisitions/{purchase_requisition_id}/purchase_orders/{purchase_order_id}/purchase_order_lines/{purchase_order_line_id}")
public ResponseEntity<Purchase_order_lineDTO> getByRes_partnerPurchase_requisitionPurchase_order(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_requisition_id") Long purchase_requisition_id, @PathVariable("purchase_order_id") Long purchase_order_id, @PathVariable("purchase_order_line_id") Long purchase_order_line_id) {
Purchase_order_line domain = purchase_order_lineService.get(purchase_order_line_id);
Purchase_order_lineDTO dto = purchase_order_lineMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据联系人采购申请采购订单获取采购订单行草稿", tags = {"采购订单行" }, notes = "根据联系人采购申请采购订单获取采购订单行草稿")
@RequestMapping(method = RequestMethod.GET, value = "/res_partners/{res_partner_id}/purchase_requisitions/{purchase_requisition_id}/purchase_orders/{purchase_order_id}/purchase_order_lines/getdraft")
public ResponseEntity<Purchase_order_lineDTO> getDraftByRes_partnerPurchase_requisitionPurchase_order(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_requisition_id") Long purchase_requisition_id, @PathVariable("purchase_order_id") Long purchase_order_id) {
Purchase_order_line domain = new Purchase_order_line();
domain.setOrderId(purchase_order_id);
return ResponseEntity.status(HttpStatus.OK).body(purchase_order_lineMapping.toDto(purchase_order_lineService.getDraft(domain)));
}
@ApiOperation(value = "根据联系人采购申请采购订单检查采购订单行", tags = {"采购订单行" }, notes = "根据联系人采购申请采购订单检查采购订单行")
@RequestMapping(method = RequestMethod.POST, value = "/res_partners/{res_partner_id}/purchase_requisitions/{purchase_requisition_id}/purchase_orders/{purchase_order_id}/purchase_order_lines/checkkey")
public ResponseEntity<Boolean> checkKeyByRes_partnerPurchase_requisitionPurchase_order(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_requisition_id") Long purchase_requisition_id, @PathVariable("purchase_order_id") Long purchase_order_id, @RequestBody Purchase_order_lineDTO purchase_order_linedto) {
return ResponseEntity.status(HttpStatus.OK).body(purchase_order_lineService.checkKey(purchase_order_lineMapping.toDomain(purchase_order_linedto)));
}
@PreAuthorize("hasPermission(this.purchase_order_lineMapping.toDomain(#purchase_order_linedto),'iBizBusinessCentral-Purchase_order_line-Save')")
@ApiOperation(value = "根据联系人采购申请采购订单保存采购订单行", tags = {"采购订单行" }, notes = "根据联系人采购申请采购订单保存采购订单行")
@RequestMapping(method = RequestMethod.POST, value = "/res_partners/{res_partner_id}/purchase_requisitions/{purchase_requisition_id}/purchase_orders/{purchase_order_id}/purchase_order_lines/save")
public ResponseEntity<Boolean> saveByRes_partnerPurchase_requisitionPurchase_order(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_requisition_id") Long purchase_requisition_id, @PathVariable("purchase_order_id") Long purchase_order_id, @RequestBody Purchase_order_lineDTO purchase_order_linedto) {
Purchase_order_line domain = purchase_order_lineMapping.toDomain(purchase_order_linedto);
domain.setOrderId(purchase_order_id);
return ResponseEntity.status(HttpStatus.OK).body(purchase_order_lineService.save(domain));
}
@PreAuthorize("hasPermission(this.purchase_order_lineMapping.toDomain(#purchase_order_linedtos),'iBizBusinessCentral-Purchase_order_line-Save')")
@ApiOperation(value = "根据联系人采购申请采购订单批量保存采购订单行", tags = {"采购订单行" }, notes = "根据联系人采购申请采购订单批量保存采购订单行")
@RequestMapping(method = RequestMethod.POST, value = "/res_partners/{res_partner_id}/purchase_requisitions/{purchase_requisition_id}/purchase_orders/{purchase_order_id}/purchase_order_lines/savebatch")
public ResponseEntity<Boolean> saveBatchByRes_partnerPurchase_requisitionPurchase_order(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_requisition_id") Long purchase_requisition_id, @PathVariable("purchase_order_id") Long purchase_order_id, @RequestBody List<Purchase_order_lineDTO> purchase_order_linedtos) {
List<Purchase_order_line> domainlist=purchase_order_lineMapping.toDomain(purchase_order_linedtos);
for(Purchase_order_line domain:domainlist){
domain.setOrderId(purchase_order_id);
}
purchase_order_lineService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_order_line-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-Purchase_order_line-Get')")
@ApiOperation(value = "根据联系人采购申请采购订单获取数据集", tags = {"采购订单行" } ,notes = "根据联系人采购申请采购订单获取数据集")
@RequestMapping(method= RequestMethod.GET , value="/res_partners/{res_partner_id}/purchase_requisitions/{purchase_requisition_id}/purchase_orders/{purchase_order_id}/purchase_order_lines/fetchdefault")
public ResponseEntity<List<Purchase_order_lineDTO>> fetchPurchase_order_lineDefaultByRes_partnerPurchase_requisitionPurchase_order(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_requisition_id") Long purchase_requisition_id, @PathVariable("purchase_order_id") Long purchase_order_id,Purchase_order_lineSearchContext context) {
context.setN_order_id_eq(purchase_order_id);
Page<Purchase_order_line> domains = purchase_order_lineService.searchDefault(context) ;
List<Purchase_order_lineDTO> list = purchase_order_lineMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_order_line-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-Purchase_order_line-Get')")
@ApiOperation(value = "根据联系人采购申请采购订单查询数据集", tags = {"采购订单行" } ,notes = "根据联系人采购申请采购订单查询数据集")
@RequestMapping(method= RequestMethod.POST , value="/res_partners/{res_partner_id}/purchase_requisitions/{purchase_requisition_id}/purchase_orders/{purchase_order_id}/purchase_order_lines/searchdefault")
public ResponseEntity<Page<Purchase_order_lineDTO>> searchPurchase_order_lineDefaultByRes_partnerPurchase_requisitionPurchase_order(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_requisition_id") Long purchase_requisition_id, @PathVariable("purchase_order_id") Long purchase_order_id, @RequestBody Purchase_order_lineSearchContext context) {
context.setN_order_id_eq(purchase_order_id);
Page<Purchase_order_line> domains = purchase_order_lineService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(purchase_order_lineMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
} }
...@@ -224,5 +224,200 @@ public class Purchase_requisitionResource { ...@@ -224,5 +224,200 @@ public class Purchase_requisitionResource {
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_requisition-Create-all')")
@ApiOperation(value = "根据联系人建立采购申请", tags = {"采购申请" }, notes = "根据联系人建立采购申请")
@RequestMapping(method = RequestMethod.POST, value = "/res_partners/{res_partner_id}/purchase_requisitions")
public ResponseEntity<Purchase_requisitionDTO> createByRes_partner(@PathVariable("res_partner_id") Long res_partner_id, @RequestBody Purchase_requisitionDTO purchase_requisitiondto) {
Purchase_requisition domain = purchase_requisitionMapping.toDomain(purchase_requisitiondto);
domain.setVendorId(res_partner_id);
purchase_requisitionService.create(domain);
Purchase_requisitionDTO dto = purchase_requisitionMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_requisition-Create-all')")
@ApiOperation(value = "根据联系人批量建立采购申请", tags = {"采购申请" }, notes = "根据联系人批量建立采购申请")
@RequestMapping(method = RequestMethod.POST, value = "/res_partners/{res_partner_id}/purchase_requisitions/batch")
public ResponseEntity<Boolean> createBatchByRes_partner(@PathVariable("res_partner_id") Long res_partner_id, @RequestBody List<Purchase_requisitionDTO> purchase_requisitiondtos) {
List<Purchase_requisition> domainlist=purchase_requisitionMapping.toDomain(purchase_requisitiondtos);
for(Purchase_requisition domain:domainlist){
domain.setVendorId(res_partner_id);
}
purchase_requisitionService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_requisition-Update-all')")
@ApiOperation(value = "根据联系人更新采购申请", tags = {"采购申请" }, notes = "根据联系人更新采购申请")
@RequestMapping(method = RequestMethod.PUT, value = "/res_partners/{res_partner_id}/purchase_requisitions/{purchase_requisition_id}")
public ResponseEntity<Purchase_requisitionDTO> updateByRes_partner(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_requisition_id") Long purchase_requisition_id, @RequestBody Purchase_requisitionDTO purchase_requisitiondto) {
Purchase_requisition domain = purchase_requisitionMapping.toDomain(purchase_requisitiondto);
domain.setVendorId(res_partner_id);
domain.setId(purchase_requisition_id);
purchase_requisitionService.update(domain);
Purchase_requisitionDTO dto = purchase_requisitionMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_requisition-Update-all')")
@ApiOperation(value = "根据联系人批量更新采购申请", tags = {"采购申请" }, notes = "根据联系人批量更新采购申请")
@RequestMapping(method = RequestMethod.PUT, value = "/res_partners/{res_partner_id}/purchase_requisitions/batch")
public ResponseEntity<Boolean> updateBatchByRes_partner(@PathVariable("res_partner_id") Long res_partner_id, @RequestBody List<Purchase_requisitionDTO> purchase_requisitiondtos) {
List<Purchase_requisition> domainlist=purchase_requisitionMapping.toDomain(purchase_requisitiondtos);
for(Purchase_requisition domain:domainlist){
domain.setVendorId(res_partner_id);
}
purchase_requisitionService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_requisition-Remove-all')")
@ApiOperation(value = "根据联系人删除采购申请", tags = {"采购申请" }, notes = "根据联系人删除采购申请")
@RequestMapping(method = RequestMethod.DELETE, value = "/res_partners/{res_partner_id}/purchase_requisitions/{purchase_requisition_id}")
public ResponseEntity<Boolean> removeByRes_partner(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_requisition_id") Long purchase_requisition_id) {
return ResponseEntity.status(HttpStatus.OK).body(purchase_requisitionService.remove(purchase_requisition_id));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_requisition-Remove-all')")
@ApiOperation(value = "根据联系人批量删除采购申请", tags = {"采购申请" }, notes = "根据联系人批量删除采购申请")
@RequestMapping(method = RequestMethod.DELETE, value = "/res_partners/{res_partner_id}/purchase_requisitions/batch")
public ResponseEntity<Boolean> removeBatchByRes_partner(@RequestBody List<Long> ids) {
purchase_requisitionService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_requisition-Get-all')")
@ApiOperation(value = "根据联系人获取采购申请", tags = {"采购申请" }, notes = "根据联系人获取采购申请")
@RequestMapping(method = RequestMethod.GET, value = "/res_partners/{res_partner_id}/purchase_requisitions/{purchase_requisition_id}")
public ResponseEntity<Purchase_requisitionDTO> getByRes_partner(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_requisition_id") Long purchase_requisition_id) {
Purchase_requisition domain = purchase_requisitionService.get(purchase_requisition_id);
Purchase_requisitionDTO dto = purchase_requisitionMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据联系人获取采购申请草稿", tags = {"采购申请" }, notes = "根据联系人获取采购申请草稿")
@RequestMapping(method = RequestMethod.GET, value = "/res_partners/{res_partner_id}/purchase_requisitions/getdraft")
public ResponseEntity<Purchase_requisitionDTO> getDraftByRes_partner(@PathVariable("res_partner_id") Long res_partner_id) {
Purchase_requisition domain = new Purchase_requisition();
domain.setVendorId(res_partner_id);
return ResponseEntity.status(HttpStatus.OK).body(purchase_requisitionMapping.toDto(purchase_requisitionService.getDraft(domain)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_requisition-Action_cancel-all')")
@ApiOperation(value = "根据联系人采购申请", tags = {"采购申请" }, notes = "根据联系人采购申请")
@RequestMapping(method = RequestMethod.POST, value = "/res_partners/{res_partner_id}/purchase_requisitions/{purchase_requisition_id}/action_cancel")
public ResponseEntity<Purchase_requisitionDTO> action_cancelByRes_partner(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_requisition_id") Long purchase_requisition_id, @RequestBody Purchase_requisitionDTO purchase_requisitiondto) {
Purchase_requisition domain = purchase_requisitionMapping.toDomain(purchase_requisitiondto);
domain.setVendorId(res_partner_id);
domain = purchase_requisitionService.action_cancel(domain) ;
purchase_requisitiondto = purchase_requisitionMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(purchase_requisitiondto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_requisition-Action_done-all')")
@ApiOperation(value = "根据联系人采购申请", tags = {"采购申请" }, notes = "根据联系人采购申请")
@RequestMapping(method = RequestMethod.POST, value = "/res_partners/{res_partner_id}/purchase_requisitions/{purchase_requisition_id}/action_done")
public ResponseEntity<Purchase_requisitionDTO> action_doneByRes_partner(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_requisition_id") Long purchase_requisition_id, @RequestBody Purchase_requisitionDTO purchase_requisitiondto) {
Purchase_requisition domain = purchase_requisitionMapping.toDomain(purchase_requisitiondto);
domain.setVendorId(res_partner_id);
domain = purchase_requisitionService.action_done(domain) ;
purchase_requisitiondto = purchase_requisitionMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(purchase_requisitiondto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_requisition-Action_draft-all')")
@ApiOperation(value = "根据联系人采购申请", tags = {"采购申请" }, notes = "根据联系人采购申请")
@RequestMapping(method = RequestMethod.POST, value = "/res_partners/{res_partner_id}/purchase_requisitions/{purchase_requisition_id}/action_draft")
public ResponseEntity<Purchase_requisitionDTO> action_draftByRes_partner(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_requisition_id") Long purchase_requisition_id, @RequestBody Purchase_requisitionDTO purchase_requisitiondto) {
Purchase_requisition domain = purchase_requisitionMapping.toDomain(purchase_requisitiondto);
domain.setVendorId(res_partner_id);
domain = purchase_requisitionService.action_draft(domain) ;
purchase_requisitiondto = purchase_requisitionMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(purchase_requisitiondto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_requisition-Action_in_progress-all')")
@ApiOperation(value = "根据联系人采购申请", tags = {"采购申请" }, notes = "根据联系人采购申请")
@RequestMapping(method = RequestMethod.POST, value = "/res_partners/{res_partner_id}/purchase_requisitions/{purchase_requisition_id}/action_in_progress")
public ResponseEntity<Purchase_requisitionDTO> action_in_progressByRes_partner(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_requisition_id") Long purchase_requisition_id, @RequestBody Purchase_requisitionDTO purchase_requisitiondto) {
Purchase_requisition domain = purchase_requisitionMapping.toDomain(purchase_requisitiondto);
domain.setVendorId(res_partner_id);
domain = purchase_requisitionService.action_in_progress(domain) ;
purchase_requisitiondto = purchase_requisitionMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(purchase_requisitiondto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_requisition-Action_open-all')")
@ApiOperation(value = "根据联系人采购申请", tags = {"采购申请" }, notes = "根据联系人采购申请")
@RequestMapping(method = RequestMethod.POST, value = "/res_partners/{res_partner_id}/purchase_requisitions/{purchase_requisition_id}/action_open")
public ResponseEntity<Purchase_requisitionDTO> action_openByRes_partner(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_requisition_id") Long purchase_requisition_id, @RequestBody Purchase_requisitionDTO purchase_requisitiondto) {
Purchase_requisition domain = purchase_requisitionMapping.toDomain(purchase_requisitiondto);
domain.setVendorId(res_partner_id);
domain = purchase_requisitionService.action_open(domain) ;
purchase_requisitiondto = purchase_requisitionMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(purchase_requisitiondto);
}
@ApiOperation(value = "根据联系人检查采购申请", tags = {"采购申请" }, notes = "根据联系人检查采购申请")
@RequestMapping(method = RequestMethod.POST, value = "/res_partners/{res_partner_id}/purchase_requisitions/checkkey")
public ResponseEntity<Boolean> checkKeyByRes_partner(@PathVariable("res_partner_id") Long res_partner_id, @RequestBody Purchase_requisitionDTO purchase_requisitiondto) {
return ResponseEntity.status(HttpStatus.OK).body(purchase_requisitionService.checkKey(purchase_requisitionMapping.toDomain(purchase_requisitiondto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_requisition-MasterTabCount-all')")
@ApiOperation(value = "根据联系人采购申请", tags = {"采购申请" }, notes = "根据联系人采购申请")
@RequestMapping(method = RequestMethod.POST, value = "/res_partners/{res_partner_id}/purchase_requisitions/{purchase_requisition_id}/mastertabcount")
public ResponseEntity<Purchase_requisitionDTO> masterTabCountByRes_partner(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_requisition_id") Long purchase_requisition_id, @RequestBody Purchase_requisitionDTO purchase_requisitiondto) {
Purchase_requisition domain = purchase_requisitionMapping.toDomain(purchase_requisitiondto);
domain.setVendorId(res_partner_id);
domain = purchase_requisitionService.masterTabCount(domain) ;
purchase_requisitiondto = purchase_requisitionMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(purchase_requisitiondto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_requisition-Save-all')")
@ApiOperation(value = "根据联系人保存采购申请", tags = {"采购申请" }, notes = "根据联系人保存采购申请")
@RequestMapping(method = RequestMethod.POST, value = "/res_partners/{res_partner_id}/purchase_requisitions/save")
public ResponseEntity<Boolean> saveByRes_partner(@PathVariable("res_partner_id") Long res_partner_id, @RequestBody Purchase_requisitionDTO purchase_requisitiondto) {
Purchase_requisition domain = purchase_requisitionMapping.toDomain(purchase_requisitiondto);
domain.setVendorId(res_partner_id);
return ResponseEntity.status(HttpStatus.OK).body(purchase_requisitionService.save(domain));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_requisition-Save-all')")
@ApiOperation(value = "根据联系人批量保存采购申请", tags = {"采购申请" }, notes = "根据联系人批量保存采购申请")
@RequestMapping(method = RequestMethod.POST, value = "/res_partners/{res_partner_id}/purchase_requisitions/savebatch")
public ResponseEntity<Boolean> saveBatchByRes_partner(@PathVariable("res_partner_id") Long res_partner_id, @RequestBody List<Purchase_requisitionDTO> purchase_requisitiondtos) {
List<Purchase_requisition> domainlist=purchase_requisitionMapping.toDomain(purchase_requisitiondtos);
for(Purchase_requisition domain:domainlist){
domain.setVendorId(res_partner_id);
}
purchase_requisitionService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_requisition-searchDefault-all')")
@ApiOperation(value = "根据联系人获取数据集", tags = {"采购申请" } ,notes = "根据联系人获取数据集")
@RequestMapping(method= RequestMethod.GET , value="/res_partners/{res_partner_id}/purchase_requisitions/fetchdefault")
public ResponseEntity<List<Purchase_requisitionDTO>> fetchPurchase_requisitionDefaultByRes_partner(@PathVariable("res_partner_id") Long res_partner_id,Purchase_requisitionSearchContext context) {
context.setN_vendor_id_eq(res_partner_id);
Page<Purchase_requisition> domains = purchase_requisitionService.searchDefault(context) ;
List<Purchase_requisitionDTO> list = purchase_requisitionMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_requisition-searchDefault-all')")
@ApiOperation(value = "根据联系人查询数据集", tags = {"采购申请" } ,notes = "根据联系人查询数据集")
@RequestMapping(method= RequestMethod.POST , value="/res_partners/{res_partner_id}/purchase_requisitions/searchdefault")
public ResponseEntity<Page<Purchase_requisitionDTO>> searchPurchase_requisitionDefaultByRes_partner(@PathVariable("res_partner_id") Long res_partner_id, @RequestBody Purchase_requisitionSearchContext context) {
context.setN_vendor_id_eq(res_partner_id);
Page<Purchase_requisition> domains = purchase_requisitionService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(purchase_requisitionMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
} }
...@@ -287,5 +287,134 @@ public class Purchase_requisition_lineResource { ...@@ -287,5 +287,134 @@ public class Purchase_requisition_lineResource {
return ResponseEntity.status(HttpStatus.OK) return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(purchase_requisition_lineMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements())); .body(new PageImpl(purchase_requisition_lineMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_requisition_line-Create-all')")
@ApiOperation(value = "根据联系人采购申请建立采购申请行", tags = {"采购申请行" }, notes = "根据联系人采购申请建立采购申请行")
@RequestMapping(method = RequestMethod.POST, value = "/res_partners/{res_partner_id}/purchase_requisitions/{purchase_requisition_id}/purchase_requisition_lines")
public ResponseEntity<Purchase_requisition_lineDTO> createByRes_partnerPurchase_requisition(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_requisition_id") Long purchase_requisition_id, @RequestBody Purchase_requisition_lineDTO purchase_requisition_linedto) {
Purchase_requisition_line domain = purchase_requisition_lineMapping.toDomain(purchase_requisition_linedto);
domain.setRequisitionId(purchase_requisition_id);
purchase_requisition_lineService.create(domain);
Purchase_requisition_lineDTO dto = purchase_requisition_lineMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_requisition_line-Create-all')")
@ApiOperation(value = "根据联系人采购申请批量建立采购申请行", tags = {"采购申请行" }, notes = "根据联系人采购申请批量建立采购申请行")
@RequestMapping(method = RequestMethod.POST, value = "/res_partners/{res_partner_id}/purchase_requisitions/{purchase_requisition_id}/purchase_requisition_lines/batch")
public ResponseEntity<Boolean> createBatchByRes_partnerPurchase_requisition(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_requisition_id") Long purchase_requisition_id, @RequestBody List<Purchase_requisition_lineDTO> purchase_requisition_linedtos) {
List<Purchase_requisition_line> domainlist=purchase_requisition_lineMapping.toDomain(purchase_requisition_linedtos);
for(Purchase_requisition_line domain:domainlist){
domain.setRequisitionId(purchase_requisition_id);
}
purchase_requisition_lineService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_requisition_line-Update-all')")
@ApiOperation(value = "根据联系人采购申请更新采购申请行", tags = {"采购申请行" }, notes = "根据联系人采购申请更新采购申请行")
@RequestMapping(method = RequestMethod.PUT, value = "/res_partners/{res_partner_id}/purchase_requisitions/{purchase_requisition_id}/purchase_requisition_lines/{purchase_requisition_line_id}")
public ResponseEntity<Purchase_requisition_lineDTO> updateByRes_partnerPurchase_requisition(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_requisition_id") Long purchase_requisition_id, @PathVariable("purchase_requisition_line_id") Long purchase_requisition_line_id, @RequestBody Purchase_requisition_lineDTO purchase_requisition_linedto) {
Purchase_requisition_line domain = purchase_requisition_lineMapping.toDomain(purchase_requisition_linedto);
domain.setRequisitionId(purchase_requisition_id);
domain.setId(purchase_requisition_line_id);
purchase_requisition_lineService.update(domain);
Purchase_requisition_lineDTO dto = purchase_requisition_lineMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_requisition_line-Update-all')")
@ApiOperation(value = "根据联系人采购申请批量更新采购申请行", tags = {"采购申请行" }, notes = "根据联系人采购申请批量更新采购申请行")
@RequestMapping(method = RequestMethod.PUT, value = "/res_partners/{res_partner_id}/purchase_requisitions/{purchase_requisition_id}/purchase_requisition_lines/batch")
public ResponseEntity<Boolean> updateBatchByRes_partnerPurchase_requisition(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_requisition_id") Long purchase_requisition_id, @RequestBody List<Purchase_requisition_lineDTO> purchase_requisition_linedtos) {
List<Purchase_requisition_line> domainlist=purchase_requisition_lineMapping.toDomain(purchase_requisition_linedtos);
for(Purchase_requisition_line domain:domainlist){
domain.setRequisitionId(purchase_requisition_id);
}
purchase_requisition_lineService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_requisition_line-Remove-all')")
@ApiOperation(value = "根据联系人采购申请删除采购申请行", tags = {"采购申请行" }, notes = "根据联系人采购申请删除采购申请行")
@RequestMapping(method = RequestMethod.DELETE, value = "/res_partners/{res_partner_id}/purchase_requisitions/{purchase_requisition_id}/purchase_requisition_lines/{purchase_requisition_line_id}")
public ResponseEntity<Boolean> removeByRes_partnerPurchase_requisition(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_requisition_id") Long purchase_requisition_id, @PathVariable("purchase_requisition_line_id") Long purchase_requisition_line_id) {
return ResponseEntity.status(HttpStatus.OK).body(purchase_requisition_lineService.remove(purchase_requisition_line_id));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_requisition_line-Remove-all')")
@ApiOperation(value = "根据联系人采购申请批量删除采购申请行", tags = {"采购申请行" }, notes = "根据联系人采购申请批量删除采购申请行")
@RequestMapping(method = RequestMethod.DELETE, value = "/res_partners/{res_partner_id}/purchase_requisitions/{purchase_requisition_id}/purchase_requisition_lines/batch")
public ResponseEntity<Boolean> removeBatchByRes_partnerPurchase_requisition(@RequestBody List<Long> ids) {
purchase_requisition_lineService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_requisition_line-Get-all')")
@ApiOperation(value = "根据联系人采购申请获取采购申请行", tags = {"采购申请行" }, notes = "根据联系人采购申请获取采购申请行")
@RequestMapping(method = RequestMethod.GET, value = "/res_partners/{res_partner_id}/purchase_requisitions/{purchase_requisition_id}/purchase_requisition_lines/{purchase_requisition_line_id}")
public ResponseEntity<Purchase_requisition_lineDTO> getByRes_partnerPurchase_requisition(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_requisition_id") Long purchase_requisition_id, @PathVariable("purchase_requisition_line_id") Long purchase_requisition_line_id) {
Purchase_requisition_line domain = purchase_requisition_lineService.get(purchase_requisition_line_id);
Purchase_requisition_lineDTO dto = purchase_requisition_lineMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据联系人采购申请获取采购申请行草稿", tags = {"采购申请行" }, notes = "根据联系人采购申请获取采购申请行草稿")
@RequestMapping(method = RequestMethod.GET, value = "/res_partners/{res_partner_id}/purchase_requisitions/{purchase_requisition_id}/purchase_requisition_lines/getdraft")
public ResponseEntity<Purchase_requisition_lineDTO> getDraftByRes_partnerPurchase_requisition(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_requisition_id") Long purchase_requisition_id) {
Purchase_requisition_line domain = new Purchase_requisition_line();
domain.setRequisitionId(purchase_requisition_id);
return ResponseEntity.status(HttpStatus.OK).body(purchase_requisition_lineMapping.toDto(purchase_requisition_lineService.getDraft(domain)));
}
@ApiOperation(value = "根据联系人采购申请检查采购申请行", tags = {"采购申请行" }, notes = "根据联系人采购申请检查采购申请行")
@RequestMapping(method = RequestMethod.POST, value = "/res_partners/{res_partner_id}/purchase_requisitions/{purchase_requisition_id}/purchase_requisition_lines/checkkey")
public ResponseEntity<Boolean> checkKeyByRes_partnerPurchase_requisition(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_requisition_id") Long purchase_requisition_id, @RequestBody Purchase_requisition_lineDTO purchase_requisition_linedto) {
return ResponseEntity.status(HttpStatus.OK).body(purchase_requisition_lineService.checkKey(purchase_requisition_lineMapping.toDomain(purchase_requisition_linedto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_requisition_line-Save-all')")
@ApiOperation(value = "根据联系人采购申请保存采购申请行", tags = {"采购申请行" }, notes = "根据联系人采购申请保存采购申请行")
@RequestMapping(method = RequestMethod.POST, value = "/res_partners/{res_partner_id}/purchase_requisitions/{purchase_requisition_id}/purchase_requisition_lines/save")
public ResponseEntity<Boolean> saveByRes_partnerPurchase_requisition(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_requisition_id") Long purchase_requisition_id, @RequestBody Purchase_requisition_lineDTO purchase_requisition_linedto) {
Purchase_requisition_line domain = purchase_requisition_lineMapping.toDomain(purchase_requisition_linedto);
domain.setRequisitionId(purchase_requisition_id);
return ResponseEntity.status(HttpStatus.OK).body(purchase_requisition_lineService.save(domain));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_requisition_line-Save-all')")
@ApiOperation(value = "根据联系人采购申请批量保存采购申请行", tags = {"采购申请行" }, notes = "根据联系人采购申请批量保存采购申请行")
@RequestMapping(method = RequestMethod.POST, value = "/res_partners/{res_partner_id}/purchase_requisitions/{purchase_requisition_id}/purchase_requisition_lines/savebatch")
public ResponseEntity<Boolean> saveBatchByRes_partnerPurchase_requisition(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_requisition_id") Long purchase_requisition_id, @RequestBody List<Purchase_requisition_lineDTO> purchase_requisition_linedtos) {
List<Purchase_requisition_line> domainlist=purchase_requisition_lineMapping.toDomain(purchase_requisition_linedtos);
for(Purchase_requisition_line domain:domainlist){
domain.setRequisitionId(purchase_requisition_id);
}
purchase_requisition_lineService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_requisition_line-searchDefault-all')")
@ApiOperation(value = "根据联系人采购申请获取数据集", tags = {"采购申请行" } ,notes = "根据联系人采购申请获取数据集")
@RequestMapping(method= RequestMethod.GET , value="/res_partners/{res_partner_id}/purchase_requisitions/{purchase_requisition_id}/purchase_requisition_lines/fetchdefault")
public ResponseEntity<List<Purchase_requisition_lineDTO>> fetchPurchase_requisition_lineDefaultByRes_partnerPurchase_requisition(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_requisition_id") Long purchase_requisition_id,Purchase_requisition_lineSearchContext context) {
context.setN_requisition_id_eq(purchase_requisition_id);
Page<Purchase_requisition_line> domains = purchase_requisition_lineService.searchDefault(context) ;
List<Purchase_requisition_lineDTO> list = purchase_requisition_lineMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_requisition_line-searchDefault-all')")
@ApiOperation(value = "根据联系人采购申请查询数据集", tags = {"采购申请行" } ,notes = "根据联系人采购申请查询数据集")
@RequestMapping(method= RequestMethod.POST , value="/res_partners/{res_partner_id}/purchase_requisitions/{purchase_requisition_id}/purchase_requisition_lines/searchdefault")
public ResponseEntity<Page<Purchase_requisition_lineDTO>> searchPurchase_requisition_lineDefaultByRes_partnerPurchase_requisition(@PathVariable("res_partner_id") Long res_partner_id, @PathVariable("purchase_requisition_id") Long purchase_requisition_id, @RequestBody Purchase_requisition_lineSearchContext context) {
context.setN_requisition_id_eq(purchase_requisition_id);
Page<Purchase_requisition_line> domains = purchase_requisition_lineService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(purchase_requisition_lineMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
} }
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册