| | |
| | | import com.xzx.gc.common.constant.CommonEnum; |
| | | import com.xzx.gc.common.constant.Constants; |
| | | import com.xzx.gc.common.dto.log.OperationAppLog; |
| | | import com.xzx.gc.common.exception.RestException; |
| | | import com.xzx.gc.common.request.BaseController; |
| | | import com.xzx.gc.entity.JhyInfo; |
| | | import com.xzx.gc.entity.JhyOrder; |
| | |
| | | return JsonResult.success("操作成功!"); |
| | | } |
| | | |
| | | /** |
| | | * 指派订单 |
| | | */ |
| | | @PostMapping(Constants.ADMIN_VIEW_PREFIX + "/score/jhy/assignJhyOrder.json") |
| | | @ApiOperation(value="集物员订单管理-指派订单", notes="test: 仅0有正确返回") |
| | | public JsonResult assignJhyOrder(@RequestBody AssignJhyOrderDto model, HttpServletRequest request) { |
| | | long orderId = model.getOrderId(); |
| | | JhyOrder jhyOrder = jhyOrderMapper.selectByPrimaryKey(orderId); |
| | | if(ObjectUtil.isEmpty(jhyOrder)){ |
| | | return JsonResult.failMessage("当前记录不存在!"); |
| | | } |
| | | Integer status = jhyOrder.getStatus(); |
| | | if(JhyOrder.ORDER_STATUS_WAITING != status){ |
| | | return JsonResult.failMessage("订单不是待接单状态,不允许指派!"); |
| | | } |
| | | long jhyId = model.getJhyId(); |
| | | JhyInfo jhyInfo = jhyOrderMapper.selectJhyInfoByUserId(jhyId); |
| | | if (jhyInfo == null || !JhyInfo.CHECK_PASS.equals(jhyInfo.getStatus())) { |
| | | return JsonResult.failMessage("不是集货员!"); |
| | | } |
| | | jhyService.assignJhyOrder(model); |
| | | OperationAppLog build = OperationAppLog.builder().appPrograme(CommonEnum.后台.getValue()).opreateName(getAdminName(request)) |
| | | .methodName(Constants.SCORESHOP_MODUL_NAME).operateAction("集物员管理-指派订单-" + orderId).build(); |
| | | mqUtil.sendApp(build); |
| | | return JsonResult.success("操作成功!"); |
| | | } |
| | | |
| | | |
| | | } |