| | |
| | | import com.xzx.gc.common.constant.Constants; |
| | | import com.xzx.gc.common.dto.log.OperationAppLog; |
| | | import com.xzx.gc.common.request.BaseController; |
| | | import com.xzx.gc.entity.ScoreGoods; |
| | | import com.xzx.gc.entity.ScoreOrder; |
| | | import com.xzx.gc.model.JsonResult; |
| | | import com.xzx.gc.shop.dto.*; |
| | | import com.xzx.gc.shop.mapper.ScoreOrderMapper; |
| | | import com.xzx.gc.shop.service.OrderService; |
| | | import com.xzx.gc.shop.vo.QueryGoodsListVo; |
| | | import com.xzx.gc.shop.vo.QueryOrderListVo; |
| | | import com.xzx.gc.shop.vo.ViewGoodsVo; |
| | | import com.xzx.gc.shop.vo.ViewOrderVo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | @ApiOperation(value="订单管理-查询订单详情", notes="test: 仅0有正确返回") |
| | | public JsonResult<ViewOrderVo> viewOrder(@RequestBody ViewOrderDto viewOrderDto) { |
| | | Long id = viewOrderDto.getId(); |
| | | ScoreOrder scoreOrder = scoreOrderMapper.selectByPrimaryKey(id); |
| | | if(ObjectUtil.isEmpty(scoreOrder)){ |
| | | return JsonResult.failMessage("订单不存在!"); |
| | | } |
| | | ViewOrderVo viewOrderVo = orderService.viewOrder(id); |
| | | return JsonResult.success(viewOrderVo); |
| | | } |
| | |
| | | } |
| | | Integer status = scoreOrder.getStatus(); |
| | | if(ScoreOrder.STATUS_READY != status){ |
| | | return JsonResult.failMessage("当前订单不是代发货状态!"); |
| | | return JsonResult.failMessage("当前订单不是待发货状态!"); |
| | | } |
| | | String expressCom = model.getExpressCom(); |
| | | if(StrUtil.isEmpty(expressCom)){ |
| | |
| | | if(StrUtil.isEmpty(expressNo)){ |
| | | return JsonResult.failMessage("快递单号不能为空!"); |
| | | } |
| | | Long expressId = orderService.deliverGoods(model); |
| | | if(expressId > 0){ |
| | | Long aLong = orderService.deliverGoods(model); |
| | | if(aLong > 0){ |
| | | OperationAppLog build = OperationAppLog.builder().appPrograme(CommonEnum.后台.getValue()).opreateName(getAdminName(request)) |
| | | .methodName(Constants.SCORESHOP_MODUL_NAME).operateAction("订单管理-发货-" + id).build(); |
| | | mqUtil.sendApp(build); |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 取消 |
| | | */ |
| | | @PostMapping(Constants.ADMIN_VIEW_PREFIX + "/score/goods/cancelOrder.json") |
| | | @ApiOperation(value="订单管理-取消", notes="test: 仅0有正确返回") |
| | | public JsonResult cancelOrder(@RequestBody CancelOrderDto model, HttpServletRequest request) { |
| | | long id = model.getId(); |
| | | ScoreOrder scoreOrder = scoreOrderMapper.selectByPrimaryKey(id); |
| | | if(ObjectUtil.isEmpty(scoreOrder)){ |
| | | return JsonResult.failMessage("订单不存在!"); |
| | | } |
| | | Integer status = scoreOrder.getStatus(); |
| | | if(ScoreOrder.STATUS_READY != status){ |
| | | return JsonResult.failMessage("当前订单不是待发货状态!"); |
| | | } |
| | | Long aLong = orderService.cancelOrder(model); |
| | | if(aLong > 0){ |
| | | OperationAppLog build = OperationAppLog.builder().appPrograme(CommonEnum.后台.getValue()).opreateName(getAdminName(request)) |
| | | .methodName(Constants.SCORESHOP_MODUL_NAME).operateAction("订单管理-取消-" + id).build(); |
| | | mqUtil.sendApp(build); |
| | | return JsonResult.success("操作成功!"); |
| | | }else{ |
| | | return JsonResult.success("操作失败!"); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | } |