更新代码

This commit is contained in:
xiaofajia 2024-10-18 16:36:09 +08:00
parent b8b73d9e1c
commit bbcd90f9d5
4 changed files with 57 additions and 0 deletions

View File

@ -213,5 +213,19 @@ public class DlRepairTicketsController {
dlRepairTicketsService.updateRepair(reqVO);
return CommonResult.ok();
}
/**
* 更新工单状态
*
* @author 小李
* @date 15:46 2024/10/18
* @param respVO 请求对象
**/
@GetMapping("/updateStatus")
@Operation(summary = "更新工单状态")
public CommonResult<?> updateStatus(@RequestBody DlRepairTicketsRespVO respVO){
dlRepairTicketsService.updateStatus(respVO);
return CommonResult.ok();
}
}

View File

@ -116,4 +116,14 @@ public interface DlRepairTicketsService extends IService<DlRepairTickets> {
* @param reqVO 请求对象
**/
void updateRepair(DlRepairTicketsReqVO reqVO);
/**
* 更新工单状态
*
* @param respVO 请求对象
* @author 小李
* @date 15:46 2024/10/18
**/
void updateStatus(DlRepairTicketsRespVO respVO);
}

View File

@ -9,6 +9,7 @@ import cn.iocoder.yudao.common.TicketsStatusEnum;
import cn.iocoder.yudao.common.TicketsWorkStatusEnum;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.base.entity.RepairWorker;
import cn.iocoder.yudao.module.base.service.RepairRecordsService;
import cn.iocoder.yudao.module.base.service.RepairWorkerService;
import cn.iocoder.yudao.module.booking.entity.DlRepairBooking;
import cn.iocoder.yudao.module.booking.service.DlRepairBookingService;
@ -135,6 +136,9 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
private RepairWorkerService repairWorkerService;
@Resource
private RepairWorkerService workerService;
@Resource
@Lazy
private RepairRecordsService recordsService;
/**
* 维修工单表 新增
@ -509,6 +513,29 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
throw exception0(500, "工单已开始");
}
}
/**
* 更新工单状态
*
* @param respVO 请求对象
* @author 小李
* @date 15:46 2024/10/18
**/
@Override
public void updateStatus(DlRepairTicketsRespVO respVO){
// 更新工单主表
baseMapper.update(new LambdaUpdateWrapper<DlRepairTickets>()
.set(DlRepairTickets::getTicketsWorkStatus, respVO.getTicketsWorkStatus())
.eq(DlRepairTickets::getId, respVO.getId())
);
// 更新工单子表
titemService.update(new LambdaUpdateWrapper<DlRepairTitem>()
.set(DlRepairTitem::getItemStatus, respVO.getItem().getItemStatus())
.eq(DlRepairTitem::getId, respVO.getItem().getId())
);
// 记录日志
recordsService.saveRepairRecord(respVO.getId(), respVO.getItem().getId(), "", respVO.getRemark(), respVO.getImage());
}
}

View File

@ -25,4 +25,10 @@ public class DlRepairTicketsRespVO extends DlRepairTickets {
/** 预约记录ID */
private String bookingId;
/** 图片路径 */
private String image;
/** 子表单条数据 */
private DlRepairTitem item;
}