| | |
| | | return ResultUtil.success("添加成功"); |
| | | } |
| | | |
| | | @RequestMapping(value = "/signForX", method = RequestMethod.POST) |
| | | @ApiOperation(value = "签收") |
| | | public Object signForX(String orderId, int status, String content, String customerReceiveId, int time, String carId,String img) { |
| | | if (status == 1) { |
| | | if (StrUtil.isEmpty(customerReceiveId)) { |
| | | return ResultUtil.error("正常签收,接货人id必填"); |
| | | } |
| | | } |
| | | |
| | | if (StrUtil.isEmpty(carId)) { |
| | | return ResultUtil.error("车辆id不能为空"); |
| | | } |
| | | OrderTask orderTask = iOrderTaskService.getById(orderId); |
| | | orderTask.setStatus(status); |
| | | orderTask.setUserId(securityUtil.getCurrUser().getId()); |
| | | orderTask.setTime(time); |
| | | orderTask.setCarId(carId); |
| | | if (StrUtil.isNotEmpty(customerReceiveId)) { |
| | | orderTask.setCustomerReceiveId(customerReceiveId); |
| | | } |
| | | if(StrUtil.isNotEmpty(img)){ |
| | | if(StrUtil.isNotEmpty(orderTask.getImg())){ |
| | | String imgO = orderTask.getImg(); |
| | | orderTask.setImg(imgO+","+img); |
| | | }else{ |
| | | orderTask.setImg(","+img); |
| | | } |
| | | } |
| | | |
| | | if (!StrUtil.isEmpty(content)) { |
| | | orderTask.setRemarks(content); |
| | | } else { |
| | | if (status == 2) { |
| | | return ResultUtil.error("请填写异常签收原因"); |
| | | } |
| | | } |
| | | iOrderTaskService.saveOrUpdate(orderTask); |
| | | |
| | | Car car = iCarService.getById(orderTask.getCarId()); |
| | | EventLog eventLog = new EventLog(); |
| | | eventLog.setCarNo(car.getCarNo()); |
| | | eventLog.setRefId(orderId); |
| | | eventLog.setType(6);//6:配送完成 |
| | | iEventLogService.saveOrUpdate(eventLog); |
| | | |
| | | saveLog(); |
| | | return ResultUtil.success("添加成功"); |
| | | } |
| | | |
| | | private void saveLog() { |
| | | QueryWrapper<OrderLog> wp = new QueryWrapper<>(); |
| | | wp.eq("type", 2); |