| | |
| | | |
| | | import com.oying.annotation.Log; |
| | | import com.oying.modules.message.domain.MessageOrderSeller; |
| | | import com.oying.modules.message.domain.MessageOrderSeller; |
| | | import com.oying.modules.message.service.MessageOrderSellerService; |
| | | import com.oying.modules.message.domain.dto.MessageOrderSellerQueryCriteria; |
| | | import lombok.RequiredArgsConstructor; |
| | |
| | | @RestController |
| | | @RequiredArgsConstructor |
| | | @Api(tags = "卖家端订单消息通知") |
| | | @RequestMapping("/api/messageOrderSeller") |
| | | @RequestMapping("/api/message/messageOrderSeller") |
| | | public class MessageOrderSellerController { |
| | | |
| | | private final MessageOrderSellerService messageOrderSellerService; |
| | | |
| | | @ApiOperation("导出数据") |
| | | @GetMapping(value = "/download") |
| | | @PreAuthorize("@el.check('messageOrderSeller:list')") |
| | | public void exportMessageOrderSeller(HttpServletResponse response, MessageOrderSellerQueryCriteria criteria) throws IOException { |
| | | messageOrderSellerService.download(messageOrderSellerService.queryAll(criteria), response); |
| | | } |
| | | // @ApiOperation("导出数据") |
| | | // @GetMapping(value = "/download") |
| | | // @PreAuthorize("@el.check('messageOrderSeller:list')") |
| | | // public void exportMessageOrderSeller(HttpServletResponse response, MessageOrderSellerQueryCriteria criteria) throws IOException { |
| | | // messageOrderSellerService.download(messageOrderSellerService.queryAll(criteria), response); |
| | | // } |
| | | |
| | | @GetMapping |
| | | @ApiOperation("查询卖家端订单消息通知") |
| | |
| | | return new ResponseEntity<>(messageOrderSellerService.queryAll(criteria,page),HttpStatus.OK); |
| | | } |
| | | |
| | | @PostMapping |
| | | @Log("新增卖家端订单消息通知") |
| | | @ApiOperation("新增卖家端订单消息通知") |
| | | @PreAuthorize("@el.check('messageOrderSeller:add')") |
| | | public ResponseEntity<Object> createMessageOrderSeller(@Validated @RequestBody MessageOrderSeller resources){ |
| | | messageOrderSellerService.create(resources); |
| | | return new ResponseEntity<>(HttpStatus.CREATED); |
| | | // @PostMapping |
| | | // @Log("新增卖家端订单消息通知") |
| | | // @ApiOperation("新增卖家端订单消息通知") |
| | | // @PreAuthorize("@el.check('messageOrderSeller:add')") |
| | | // public ResponseEntity<Object> createMessageOrderSeller(@Validated @RequestBody MessageOrderSeller resources){ |
| | | // messageOrderSellerService.create(resources); |
| | | // return new ResponseEntity<>(HttpStatus.CREATED); |
| | | // } |
| | | // |
| | | // @PutMapping |
| | | // @Log("修改卖家端订单消息通知") |
| | | // @ApiOperation("修改卖家端订单消息通知") |
| | | // @PreAuthorize("@el.check('messageOrderSeller:edit')") |
| | | // public ResponseEntity<Object> updateMessageOrderSeller(@Validated @RequestBody MessageOrderSeller resources){ |
| | | // messageOrderSellerService.update(resources); |
| | | // return new ResponseEntity<>(HttpStatus.NO_CONTENT); |
| | | // } |
| | | // |
| | | // @DeleteMapping |
| | | // @Log("删除卖家端订单消息通知") |
| | | // @ApiOperation("删除卖家端订单消息通知") |
| | | // @PreAuthorize("@el.check('messageOrderSeller:del')") |
| | | // public ResponseEntity<Object> deleteMessageOrderSeller(@ApiParam(value = "传ID数组[]") @RequestBody List<Integer> ids) { |
| | | // messageOrderSellerService.deleteAll(ids); |
| | | // return new ResponseEntity<>(HttpStatus.OK); |
| | | // } |
| | | |
| | | //订单状态变化通知 |
| | | @GetMapping("/status/{order_id}") |
| | | @ApiOperation("查询一条订单状态变化通知") |
| | | public ResponseEntity<String> getMessageOrderSeller(@PathVariable Integer order_id) { |
| | | MessageOrderSeller messageOrderSeller = messageOrderSellerService.findByOrderId(order_id); |
| | | String message = messageOrderSeller.getMessageType(); |
| | | |
| | | return new ResponseEntity<>(message, HttpStatus.OK); |
| | | } |
| | | //订单送达通知 |
| | | @GetMapping("/deliver/{order_id}") |
| | | @ApiOperation("查询一条订单送达通知") |
| | | public ResponseEntity<String> getMessageOrderSellerDeliver(@PathVariable Integer order_id) { |
| | | MessageOrderSeller messageOrderSeller = messageOrderSellerService.findByOrderId(order_id); |
| | | String message = messageOrderSeller.getMessageType(); |
| | | //如果MessageType为订单送达,则返回message——content |
| | | if (message.equals("买家下单")) { |
| | | String messageContent = messageOrderSeller.getMessageContent(); |
| | | return new ResponseEntity<>(messageContent, HttpStatus.OK); |
| | | }else{ |
| | | //返回没送达 |
| | | return new ResponseEntity<>("买家没下单", HttpStatus.OK); |
| | | } |
| | | } |
| | | //实现点击跳转到订单详情 |
| | | @GetMapping("/link/{order_id}") |
| | | @ApiOperation("点击跳转到订单详情") |
| | | public ResponseEntity<String> getMessageOrderSellerLink(@PathVariable Integer order_id) { |
| | | MessageOrderSeller messageOrderSeller = messageOrderSellerService.findByOrderId(order_id); |
| | | String link = messageOrderSeller.getLink(); |
| | | return new ResponseEntity<>(link, HttpStatus.OK); |
| | | } |
| | | |
| | | @PutMapping |
| | | @Log("修改卖家端订单消息通知") |
| | | @ApiOperation("修改卖家端订单消息通知") |
| | | @PreAuthorize("@el.check('messageOrderSeller:edit')") |
| | | public ResponseEntity<Object> updateMessageOrderSeller(@Validated @RequestBody MessageOrderSeller resources){ |
| | | messageOrderSellerService.update(resources); |
| | | return new ResponseEntity<>(HttpStatus.NO_CONTENT); |
| | | } |
| | | |
| | | @DeleteMapping |
| | | @Log("删除卖家端订单消息通知") |
| | | @ApiOperation("删除卖家端订单消息通知") |
| | | @PreAuthorize("@el.check('messageOrderSeller:del')") |
| | | public ResponseEntity<Object> deleteMessageOrderSeller(@ApiParam(value = "传ID数组[]") @RequestBody List<Integer> ids) { |
| | | messageOrderSellerService.deleteAll(ids); |
| | | return new ResponseEntity<>(HttpStatus.OK); |
| | | } |
| | | } |