diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/app/booking/admin/BookingAPI.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/app/booking/admin/BookingAPI.java new file mode 100644 index 00000000..286b77ea --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/app/booking/admin/BookingAPI.java @@ -0,0 +1,91 @@ +package cn.iocoder.yudao.module.app.booking.admin; + +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.module.booking.entity.DlRepairBooking; +import cn.iocoder.yudao.module.booking.service.DlRepairBookingService; +import cn.iocoder.yudao.module.booking.vo.DlRepairBookingReqVO; +import cn.iocoder.yudao.module.booking.vo.DlRepairBookingRespVO; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; + +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; + +/** + * 维修预约表(DlRepairBooking)表API控制层 + * + * @author 小李 + * @date 11:04 2024/9/23 +**/ +@RestController +@RequestMapping("/api/repair/booking") +public class BookingAPI { + + /** + * 服务对象 + */ + @Resource + private DlRepairBookingService dlRepairBookingService; + + /** + * 维修预约表 新增、修改 + * + * @author 小李 + * @date 10:21 2024/9/23 + * @param repairBookingRespVO 预约对象 + **/ + @PostMapping("/update") + @Operation(summary = "维修预约表 新增、修改") + public CommonResult updateBooking(@RequestBody DlRepairBookingRespVO repairBookingRespVO) { + dlRepairBookingService.updateBooking(repairBookingRespVO); + return CommonResult.ok(); + } + + /** + * 维修预约表 删除 + * + * @author 小李 + * @date 10:26 2024/9/23 + * @param id 预约记录id + **/ + @DeleteMapping("/delete") + @Operation(summary = "维修预约表 删除") + public CommonResult deleteBooking(@RequestParam("id") String id) { + dlRepairBookingService.deleteBooking(id); + return CommonResult.ok(); + } + + + /** + * 维修预约表 分页 + * + * @author 小李 + * @date 10:31 2024/9/23 + * @param repairBookingReqVO 请求对象 + * @param pageNo 页码 + * @param pageSize 条数 + **/ + @GetMapping("/page") + @Operation(summary = "维修预约表 分页") + public CommonResult getBookingPage(DlRepairBookingReqVO repairBookingReqVO, + @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize){ + Page page = new Page<>(pageNo, pageSize); + return success(dlRepairBookingService.getBookingPage(repairBookingReqVO, page)); + } + + /** + * 维修预约表 查询单个 + * + * @author 小李 + * @date 10:38 2024/9/23 + * @param id 预约记录id + **/ + @GetMapping("/get") + @Operation(summary = "维修预约表 查询单个") + public CommonResult getBookingById(@RequestParam("id") String id){ + return success(dlRepairBookingService.getBookingById(id)); + } +} diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/app/tickets/admin/TicketsAPI.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/app/tickets/admin/TicketsAPI.java new file mode 100644 index 00000000..94ed02a3 --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/app/tickets/admin/TicketsAPI.java @@ -0,0 +1,75 @@ +package cn.iocoder.yudao.module.app.tickets.admin; + +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.module.tickets.entity.DlRepairTickets; +import cn.iocoder.yudao.module.tickets.service.DlRepairTicketsService; +import cn.iocoder.yudao.module.tickets.vo.DlRepairTicketsReqVO; +import cn.iocoder.yudao.module.tickets.vo.DlRepairTicketsRespVO; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; + +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; + +/** + * 维修工单表(DlRepairTickets)表控制层 + * @author 小李 + * @date 18:21 2024/9/13 + **/ +@RestController +@RequestMapping("/api/repair/tickets") +public class TicketsAPI { + + /** + * 服务对象 + */ + @Resource + private DlRepairTicketsService dlRepairTicketsService; + + /** + * 维修工单表 评价 + * + * @author 小李 + * @date 10:54 2024/9/23 + * @param repairTicketsRespVO 对象 + **/ + @PostMapping("/appraise") + @Operation(summary = "维修工单表 评价") + public CommonResult setAppraise(@RequestBody DlRepairTicketsRespVO repairTicketsRespVO){ + dlRepairTicketsService.setAppraise(repairTicketsRespVO); + return CommonResult.ok(); + } + + /** + * 维修工单表 按用户的id查 + * + * @author 小李 + * @date 11:37 2024/9/23 + * @param repairTicketsReqVO 查询对象 + * @param pageNo 页码 + * @param pageSize 条数 + **/ + @GetMapping("/page") + @Operation(summary = "维修工单表 按用户的id查") + public CommonResult getTicketsPageById(DlRepairTicketsReqVO repairTicketsReqVO, + @RequestParam(value = "pageNo", defaultValue = "1")Integer pageNo, + @RequestParam(value = "pageSize", defaultValue = "10")Integer pageSize){ + Page page = new Page<>(pageNo, pageSize); + return success(dlRepairTicketsService.getTicketsPage(repairTicketsReqVO, page)); + } + + /** + * 维修工单表 查看一个工单的详细信息 + * + * @author 小李 + * @date 11:44 2024/9/23 + * @param id 工单ID + **/ + @GetMapping("/get") + @Operation(summary = "维修工单表 查看一个工单的详细信息") + public CommonResult getTicketsById(@RequestParam(value = "id") String id){ + return success(dlRepairTicketsService.getTicketsById(id)); + } +} diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/booking/controller/admin/DlRepairBookingController.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/booking/controller/admin/DlRepairBookingController.java new file mode 100644 index 00000000..20e548f6 --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/booking/controller/admin/DlRepairBookingController.java @@ -0,0 +1,91 @@ +package cn.iocoder.yudao.module.booking.controller.admin; + +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.module.booking.entity.DlRepairBooking; +import cn.iocoder.yudao.module.booking.service.DlRepairBookingService; +import cn.iocoder.yudao.module.booking.vo.DlRepairBookingReqVO; +import cn.iocoder.yudao.module.booking.vo.DlRepairBookingRespVO; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; + +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; + +/** + * 维修预约表(DlRepairBooking)表控制层 + * + * @author 小李 + * @date 10:19 2024/9/23 + **/ +@RestController +@RequestMapping("/repair/booking") +public class DlRepairBookingController { + /** + * 服务对象 + */ + @Resource + private DlRepairBookingService dlRepairBookingService; + + /** + * 维修预约表 新增、修改 + * + * @author 小李 + * @date 10:21 2024/9/23 + * @param repairBookingRespVO 预约对象 + **/ + @PostMapping("/update") + @Operation(summary = "维修预约表 新增、修改") + public CommonResult updateBooking(@RequestBody DlRepairBookingRespVO repairBookingRespVO) { + dlRepairBookingService.updateBooking(repairBookingRespVO); + return CommonResult.ok(); + } + + /** + * 维修预约表 删除 + * + * @author 小李 + * @date 10:26 2024/9/23 + * @param id 预约记录id + **/ + @DeleteMapping("/delete") + @Operation(summary = "维修预约表 删除") + public CommonResult deleteBooking(@RequestParam("id") String id) { + dlRepairBookingService.deleteBooking(id); + return CommonResult.ok(); + } + + + /** + * 维修预约表 分页 + * + * @author 小李 + * @date 10:31 2024/9/23 + * @param repairBookingReqVO 请求对象 + * @param pageNo 页码 + * @param pageSize 条数 + **/ + @GetMapping("/page") + @Operation(summary = "维修预约表 分页") + public CommonResult getBookingPage(DlRepairBookingReqVO repairBookingReqVO, + @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize){ + Page page = new Page<>(pageNo, pageSize); + return success(dlRepairBookingService.getBookingPage(repairBookingReqVO, page)); + } + + /** + * 维修预约表 查询单个 + * + * @author 小李 + * @date 10:38 2024/9/23 + * @param id 预约记录id + **/ + @GetMapping("/get") + @Operation(summary = "维修预约表 查询单个") + public CommonResult getBookingById(@RequestParam("id") String id){ + return success(dlRepairBookingService.getBookingById(id)); + } +} + diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/booking/entity/DlRepairBooking.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/booking/entity/DlRepairBooking.java new file mode 100644 index 00000000..bb19edef --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/booking/entity/DlRepairBooking.java @@ -0,0 +1,82 @@ +package cn.iocoder.yudao.module.booking.entity; + +import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; + +/** + * 维修预约表 + * + * @author 小李 + * @date 10:13 2024/9/23 + **/ +@TableName(value = "dl_repair_booking") +@Data +@EqualsAndHashCode(callSuper = true) +public class DlRepairBooking extends TenantBaseDO { + /** + * 主键标识 + */ + @TableId(type = IdType.ASSIGN_ID) + private String id; + + /** + * 用户ID(system_users的id) + */ + private Long userId; + + /** + * 用户姓名 + */ + private String userName; + + /** + * 用户手机号 + */ + private String userMobile; + + /** + * 项目ID(查PC服务分类的一级项目的ID) + */ + private String projectId; + + /** + * 车辆信息(base_car_main的id) + */ + private String carId; + + /** + * 车牌号 + */ + private String carNo; + + /** 工单ID */ + private String ticketsId; + + /** + * 预约时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @DateTimeFormat(pattern="yyyy-MM-dd") + private Date bookingTime; + + /** + * 门店ID(base_company表的ID) + */ + private String corpId; + + /** + * 部门ID + */ + private Long deptId; + + /** 预约记录状态 */ + private String bookingStatus; +} \ No newline at end of file diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/booking/mapper/DlRepairBookingMapper.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/booking/mapper/DlRepairBookingMapper.java new file mode 100644 index 00000000..a0ca944a --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/booking/mapper/DlRepairBookingMapper.java @@ -0,0 +1,32 @@ +package cn.iocoder.yudao.module.booking.mapper; + +import cn.iocoder.yudao.module.booking.entity.DlRepairBooking; +import cn.iocoder.yudao.module.booking.vo.DlRepairBookingReqVO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.apache.ibatis.annotations.Param; +import org.mapstruct.Mapper; + +/** + * 针对表【dl_repair_booking(维修预约表)】的数据库操作Mapper + * + * @author 小李 + * @date 10:16 2024/9/23 +**/ +@Mapper +public interface DlRepairBookingMapper extends BaseMapper { + + /** + * 维修预约表 分页 + * + * @author 小李 + * @date 10:31 2024/9/23 + * @param repairBookingReqVO 请求对象 + **/ + IPage getBookingPage(@Param("map") DlRepairBookingReqVO repairBookingReqVO, Page page); +} + + + + diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/booking/service/DlRepairBookingService.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/booking/service/DlRepairBookingService.java new file mode 100644 index 00000000..f9c312d2 --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/booking/service/DlRepairBookingService.java @@ -0,0 +1,53 @@ +package cn.iocoder.yudao.module.booking.service; + +import cn.iocoder.yudao.module.booking.entity.DlRepairBooking; +import cn.iocoder.yudao.module.booking.vo.DlRepairBookingReqVO; +import cn.iocoder.yudao.module.booking.vo.DlRepairBookingRespVO; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * 针对表【dl_repair_booking(维修预约表)】的数据库操作Service + * + * @author 小李 + * @date 10:18 2024/9/23 +**/ +public interface DlRepairBookingService extends IService { + + /** + * 维修预约表 新增、修改 + * + * @author 小李 + * @date 10:21 2024/9/23 + * @param repairBookingRespVO 预约对象 + **/ + void updateBooking(DlRepairBookingRespVO repairBookingRespVO); + + /** + * 维修预约表 删除 + * + * @author 小李 + * @date 10:26 2024/9/23 + * @param id 预约记录id + **/ + void deleteBooking(String id); + + /** + * 维修预约表 分页 + * + * @author 小李 + * @date 10:31 2024/9/23 + * @param repairBookingReqVO 请求对象 + **/ + IPage getBookingPage(DlRepairBookingReqVO repairBookingReqVO, Page page); + + /** + * 维修预约表 查询单个 + * + * @author 小李 + * @date 10:38 2024/9/23 + * @param id id + **/ + DlRepairBooking getBookingById(String id); +} diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/booking/service/impl/DlRepairBookingServiceImpl.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/booking/service/impl/DlRepairBookingServiceImpl.java new file mode 100644 index 00000000..28abc464 --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/booking/service/impl/DlRepairBookingServiceImpl.java @@ -0,0 +1,77 @@ +package cn.iocoder.yudao.module.booking.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import cn.iocoder.yudao.module.booking.entity.DlRepairBooking; +import cn.iocoder.yudao.module.booking.mapper.DlRepairBookingMapper; +import cn.iocoder.yudao.module.booking.service.DlRepairBookingService; +import cn.iocoder.yudao.module.booking.vo.DlRepairBookingReqVO; +import cn.iocoder.yudao.module.booking.vo.DlRepairBookingRespVO; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception0; + +/** + * 针对表【dl_repair_booking(维修预约表)】的数据库操作Service实现 + * + * @author 小李 + * @date 10:19 2024/9/23 + **/ +@Service +public class DlRepairBookingServiceImpl extends ServiceImpl + implements DlRepairBookingService { + + /** + * 维修预约表 新增、修改 + * + * @author 小李 + * @date 10:21 2024/9/23 + * @param repairBookingRespVO 预约对象 + **/ + @Override + public void updateBooking(DlRepairBookingRespVO repairBookingRespVO){ + baseMapper.insertOrUpdate(repairBookingRespVO); + } + + /** + * 维修预约表 删除 + * + * @author 小李 + * @date 10:26 2024/9/23 + * @param id 预约记录id + **/ + @Override + public void deleteBooking(String id){ + baseMapper.deleteById(id); + } + + /** + * 维修预约表 分页 + * + * @author 小李 + * @date 10:31 2024/9/23 + * @param repairBookingReqVO 请求对象 + **/ + @Override + public IPage getBookingPage(DlRepairBookingReqVO repairBookingReqVO, Page page){ + return baseMapper.getBookingPage(repairBookingReqVO, page); + } + + /** + * 维修预约表 查询单个 + * + * @author 小李 + * @date 10:38 2024/9/23 + * @param id id + **/ + @Override + public DlRepairBooking getBookingById(String id){ + return baseMapper.selectById(id); + } +} + + + + diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/booking/vo/DlRepairBookingReqVO.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/booking/vo/DlRepairBookingReqVO.java new file mode 100644 index 00000000..4d42ff78 --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/booking/vo/DlRepairBookingReqVO.java @@ -0,0 +1,25 @@ +package cn.iocoder.yudao.module.booking.vo; + +import cn.iocoder.yudao.module.booking.entity.DlRepairBooking; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +/** + * 维修预约表 请求VO + * + * @author 小李 + * @date 10:15 2024/9/23 +**/ +@Data +public class DlRepairBookingReqVO extends DlRepairBooking { + + /** 时间区间 */ + @Schema(pattern = "时间区间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private Date[] searchTimeArray; +} diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/booking/vo/DlRepairBookingRespVO.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/booking/vo/DlRepairBookingRespVO.java new file mode 100644 index 00000000..9390d110 --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/booking/vo/DlRepairBookingRespVO.java @@ -0,0 +1,14 @@ +package cn.iocoder.yudao.module.booking.vo; + +import cn.iocoder.yudao.module.booking.entity.DlRepairBooking; +import lombok.Data; + +/** + * 维修预约表 响应VO + * + * @author 小李 + * @date 10:15 2024/9/23 +**/ +@Data +public class DlRepairBookingRespVO extends DlRepairBooking { +} diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/entity/DlRepairTickets.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/entity/DlRepairTickets.java index eca56066..6728bc42 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/entity/DlRepairTickets.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/entity/DlRepairTickets.java @@ -175,4 +175,13 @@ public class DlRepairTickets extends TenantBaseDO { /** 工单进行状态 */ private String ticketsWorkStatus; + + /** 评价 */ + private String appraise; + + /** 是否已评价 */ + private String isAppraise; + + /** 评分 */ + private Integer appraiseScope; } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/DlRepairTicketsService.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/DlRepairTicketsService.java index c863452f..76fa47c9 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/DlRepairTicketsService.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/DlRepairTicketsService.java @@ -59,4 +59,13 @@ public interface DlRepairTicketsService extends IService { * @param repairTicketsRespVO 工单 **/ void setTicketsPaid(DlRepairTicketsRespVO repairTicketsRespVO); + + /** + * 维修工单表 评价 + * + * @author 小李 + * @date 10:54 2024/9/23 + * @param repairTicketsRespVO 对象 + **/ + void setAppraise(DlRepairTicketsRespVO repairTicketsRespVO); } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTicketsServiceImpl.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTicketsServiceImpl.java index 073bb6ed..6550898c 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTicketsServiceImpl.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTicketsServiceImpl.java @@ -182,6 +182,27 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl + + + + + + + + + + + + + + + + + + + + select id, + user_id, + user_name, + user_mobile, + project_id, + car_id, + car_no, + booking_time, + corp_id, + dept_id, + tickets_id, + booking_status + from dl_repair_booking drb + where drb.deleted = '0' + + + + diff --git a/dl-module-repair/src/main/resources/mapper/tickets/DlRepairTicketsMapper.xml b/dl-module-repair/src/main/resources/mapper/tickets/DlRepairTicketsMapper.xml index 978984d8..ea0177fc 100644 --- a/dl-module-repair/src/main/resources/mapper/tickets/DlRepairTicketsMapper.xml +++ b/dl-module-repair/src/main/resources/mapper/tickets/DlRepairTicketsMapper.xml @@ -42,6 +42,8 @@ + + @@ -81,7 +83,9 @@ cost, profit, part_status, - tickets_work_status + tickets_work_status, + appraise, + appraise_scope from dl_repair_tickets drt where drt.deleted = '0' @@ -116,6 +120,15 @@ and drt.corp_id = #{map.corpId} + + and drt.user_id = #{map.userId} + + + and drt.is_appraise = #{map.isAppraise} + + + and drt.tickets_work_status = #{map.ticketsWorkStatus} + order by drt.create_time desc