This commit is contained in:
Vinjor 2024-10-18 20:05:09 +08:00
commit 18dc48a103
5 changed files with 52 additions and 1 deletions

View File

@ -40,13 +40,23 @@ public interface CarMainService extends IService<CarMain> {
void deleteCarMain(String id);
/**
* 获得车辆信息
* 获得车辆及关联客户信息
*
* @param id 编号
* @return 车辆信息
*/
CarMain getCarMain(String id);
/**
* 通过id查询车辆信息
* @author PQZ
* @date 18:08 2024/10/18
* @param id 车辆id
* @return cn.iocoder.yudao.module.custom.vo.CarMainRespVO
**/
CarMainRespVO queryCarById(String id);
/**
* 获得车辆信息分页
*

View File

@ -180,6 +180,19 @@ public class CarMainServiceImpl extends ServiceImpl<CarMainMapper, CarMain> impl
return carMainRespVO;
}
/**
* 通过id查询车辆信息
*
* @param id 车辆id
* @return cn.iocoder.yudao.module.custom.vo.CarMainRespVO
* @author PQZ
* @date 18:08 2024/10/18
**/
@Override
public CarMainRespVO queryCarById(String id) {
return baseMapper.findOne(id);
}
/**
* 获得车辆信息分页
*

View File

@ -85,6 +85,7 @@
SELECT
<include refid="baseCarMainColumn"></include>,
bcb.brand_name AS brandStr,
bcb.logo_img AS logoImg,
bcm.model_name AS modelStr
FROM
`base_car_main` tbcm

View File

@ -8,12 +8,16 @@ 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.base.vo.RepairRecordsPageReqVO;
import cn.iocoder.yudao.module.base.vo.RepairRecordsRespVO;
import cn.iocoder.yudao.module.booking.entity.DlRepairBooking;
import cn.iocoder.yudao.module.booking.service.DlRepairBookingService;
import cn.iocoder.yudao.module.custom.entity.CustomerCar;
import cn.iocoder.yudao.module.custom.entity.CustomerMain;
import cn.iocoder.yudao.module.custom.service.CarMainService;
import cn.iocoder.yudao.module.custom.service.CustomerCarService;
import cn.iocoder.yudao.module.custom.service.CustomerMainService;
import cn.iocoder.yudao.module.custom.vo.CarMainRespVO;
import cn.iocoder.yudao.module.custom.vo.CustomerMainRespVO;
import cn.iocoder.yudao.module.order.service.RepairOrderInfoService;
import cn.iocoder.yudao.module.order.vo.RepairOrderInfoSaveReqVO;
@ -140,6 +144,7 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
@Autowired
private RepairRecordsService repairRecordsService;
/**
* 维修工单表 新增
*
@ -252,6 +257,12 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
// 查工单主表
DlRepairTickets dlRepairTickets = baseMapper.selectById(id);
DlRepairTicketsRespVO result = BeanUtil.toBean(dlRepairTickets, DlRepairTicketsRespVO.class);
//查车辆
CarMainRespVO carInfo = carMainService.queryCarById(dlRepairTickets.getCarId());
result.setCarInfo(carInfo);
//查用户信息
CustomerMain customerInfo = customerService.getCustomerById(dlRepairTickets.getUserId());
result.setCustomerInfo(customerInfo);
// 查工单子表
List<DlRepairTitem> itemList = titemService.list(new LambdaQueryWrapper<DlRepairTitem>().eq(DlRepairTitem::getTicketId, id));
List<DlRepairTitemReqVO> items = itemList.stream().map(item -> BeanUtil.toBean(item, DlRepairTitemReqVO.class)).collect(Collectors.toList());
@ -278,6 +289,11 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
items.forEach(item -> dlRepairOthers.stream().filter(i -> i.getId().equals(item.getOtherId())).findFirst().ifPresent(item::setOther));
}
result.setItems(items);
// 查询工单操作记录
RepairRecordsPageReqVO entity = new RepairRecordsPageReqVO();
entity.setTicketId(id);
List<RepairRecordsRespVO> records = repairRecordsService.queryList(entity);
result.setRecords(records);
return result;
}

View File

@ -1,6 +1,9 @@
package cn.iocoder.yudao.module.tickets.vo;
import cn.iocoder.yudao.module.base.vo.RepairRecordsRespVO;
import cn.iocoder.yudao.module.booking.entity.DlRepairBooking;
import cn.iocoder.yudao.module.custom.entity.CustomerMain;
import cn.iocoder.yudao.module.custom.vo.CarMainRespVO;
import cn.iocoder.yudao.module.tickets.entity.DlRepairTickets;
import cn.iocoder.yudao.module.tickets.entity.DlRepairTitem;
import lombok.Data;
@ -19,6 +22,8 @@ public class DlRepairTicketsRespVO extends DlRepairTickets {
private List<DlRepairTitem> itemList;
/** 关联的预约单信息 */
private DlRepairBooking booking;
/** 操作记录*/
private List<RepairRecordsRespVO> records;
/** 上面有地方在用,只能新用一个了,子表数组 */
private List<DlRepairTitemReqVO> items;
@ -34,4 +39,10 @@ public class DlRepairTicketsRespVO extends DlRepairTickets {
/** 记录类型 */
private String recordType;
/** 客户信息 */
private CustomerMain customerInfo;
/** 车辆信息 */
private CarMainRespVO carInfo;
}