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

xignzi006 发布系统代码

上级 a6002249
......@@ -64,6 +64,10 @@ public class purchase_orderFallback implements purchase_orderFeignClient{
public Purchase_order button_approve( Long id, Purchase_order purchase_order){
return null;
}
public Purchase_order button_cancel( Long id, Purchase_order purchase_order){
return null;
}
......
......@@ -60,6 +60,10 @@ public interface purchase_orderFeignClient {
Purchase_order getDraft();
@RequestMapping(method = RequestMethod.POST, value = "/purchase_orders/{id}/button_approve")
Purchase_order button_approve(@PathVariable("id") Long id,@RequestBody Purchase_order purchase_order);
@RequestMapping(method = RequestMethod.POST, value = "/purchase_orders/{id}/button_cancel")
Purchase_order button_cancel(@PathVariable("id") Long id,@RequestBody Purchase_order purchase_order);
......
......@@ -34,6 +34,7 @@ public interface IPurchase_orderService extends IService<Purchase_order>{
void removeBatch(Collection<Long> idList) ;
Purchase_order get(Long key) ;
Purchase_order getDraft(Purchase_order et) ;
Purchase_order button_approve(Purchase_order et) ;
Purchase_order button_cancel(Purchase_order et) ;
Purchase_order button_confirm(Purchase_order et) ;
Purchase_order button_done(Purchase_order et) ;
......
......@@ -164,6 +164,13 @@ public class Purchase_orderServiceImpl extends ServiceImpl<Purchase_orderMapper,
return et;
}
@Override
@Transactional
public Purchase_order button_approve(Purchase_order et) {
//自定义代码
return et;
}
@Override
@Transactional
public Purchase_order button_cancel(Purchase_order et) {
......
......@@ -115,6 +115,17 @@ public class Purchase_orderResource {
return ResponseEntity.status(HttpStatus.OK).body(purchase_orderMapping.toDto(purchase_orderService.getDraft(new Purchase_order())));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_order-Button_approve-all')")
@ApiOperation(value = "批准", tags = {"采购订单" }, notes = "批准")
@RequestMapping(method = RequestMethod.POST, value = "/purchase_orders/{purchase_order_id}/button_approve")
public ResponseEntity<Purchase_orderDTO> button_approve(@PathVariable("purchase_order_id") Long purchase_order_id, @RequestBody Purchase_orderDTO purchase_orderdto) {
Purchase_order domain = purchase_orderMapping.toDomain(purchase_orderdto);
domain.setId(purchase_order_id);
domain = purchase_orderService.button_approve(domain);
purchase_orderdto = purchase_orderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(purchase_orderdto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_order-Button_cancel-all')")
@ApiOperation(value = "取消", tags = {"采购订单" }, notes = "取消")
@RequestMapping(method = RequestMethod.POST, value = "/purchase_orders/{purchase_order_id}/button_cancel")
......@@ -316,6 +327,17 @@ public class Purchase_orderResource {
return ResponseEntity.status(HttpStatus.OK).body(purchase_orderMapping.toDto(purchase_orderService.getDraft(domain)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_order-Button_approve-all')")
@ApiOperation(value = "根据采购申请采购订单", tags = {"采购订单" }, notes = "根据采购申请采购订单")
@RequestMapping(method = RequestMethod.POST, value = "/purchase_requisitions/{purchase_requisition_id}/purchase_orders/{purchase_order_id}/button_approve")
public ResponseEntity<Purchase_orderDTO> button_approveByPurchase_requisition(@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_approve(domain) ;
purchase_orderdto = purchase_orderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(purchase_orderdto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_order-Button_cancel-all')")
@ApiOperation(value = "根据采购申请采购订单", tags = {"采购订单" }, notes = "根据采购申请采购订单")
@RequestMapping(method = RequestMethod.POST, value = "/purchase_requisitions/{purchase_requisition_id}/purchase_orders/{purchase_order_id}/button_cancel")
......@@ -524,6 +546,17 @@ public class Purchase_orderResource {
return ResponseEntity.status(HttpStatus.OK).body(purchase_orderMapping.toDto(purchase_orderService.getDraft(domain)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_order-Button_approve-all')")
@ApiOperation(value = "根据供应商采购订单", tags = {"采购订单" }, notes = "根据供应商采购订单")
@RequestMapping(method = RequestMethod.POST, value = "/res_suppliers/{res_supplier_id}/purchase_orders/{purchase_order_id}/button_approve")
public ResponseEntity<Purchase_orderDTO> button_approveByRes_supplier(@PathVariable("res_supplier_id") Long res_supplier_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_supplier_id);
domain = purchase_orderService.button_approve(domain) ;
purchase_orderdto = purchase_orderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(purchase_orderdto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_order-Button_cancel-all')")
@ApiOperation(value = "根据供应商采购订单", tags = {"采购订单" }, notes = "根据供应商采购订单")
@RequestMapping(method = RequestMethod.POST, value = "/res_suppliers/{res_supplier_id}/purchase_orders/{purchase_order_id}/button_cancel")
......@@ -732,6 +765,17 @@ public class Purchase_orderResource {
return ResponseEntity.status(HttpStatus.OK).body(purchase_orderMapping.toDto(purchase_orderService.getDraft(domain)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_order-Button_approve-all')")
@ApiOperation(value = "根据供应商采购申请采购订单", tags = {"采购订单" }, notes = "根据供应商采购申请采购订单")
@RequestMapping(method = RequestMethod.POST, value = "/res_suppliers/{res_supplier_id}/purchase_requisitions/{purchase_requisition_id}/purchase_orders/{purchase_order_id}/button_approve")
public ResponseEntity<Purchase_orderDTO> button_approveByRes_supplierPurchase_requisition(@PathVariable("res_supplier_id") Long res_supplier_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_approve(domain) ;
purchase_orderdto = purchase_orderMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(purchase_orderdto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_order-Button_cancel-all')")
@ApiOperation(value = "根据供应商采购申请采购订单", tags = {"采购订单" }, notes = "根据供应商采购申请采购订单")
@RequestMapping(method = RequestMethod.POST, value = "/res_suppliers/{res_supplier_id}/purchase_requisitions/{purchase_requisition_id}/purchase_orders/{purchase_order_id}/button_cancel")
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册