wjli
2023-05-25 13c9e4032de40598787a453de77ba0db94666664
接货图片和签收图片的完善
1个文件已修改
49 ■■■■■ 已修改文件
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/OrderTaskController.java 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/OrderTaskController.java
@@ -561,6 +561,55 @@
        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);