Compare commits
4 Commits
1ed5310e22
...
7e450c719a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7e450c719a | ||
|
|
e55ff5d7f7 | ||
|
|
3c3956deda | ||
|
|
3c3bef85b8 |
@ -94,5 +94,11 @@ public class BaseConstants {
|
|||||||
public static final String ORDER_KKYL = "3";
|
public static final String ORDER_KKYL = "3";
|
||||||
/**订单店铺名称*/
|
/**订单店铺名称*/
|
||||||
public static final String ORDER_TENANT_NAME = "蓝安集团";
|
public static final String ORDER_TENANT_NAME = "蓝安集团";
|
||||||
|
/**工单*/
|
||||||
|
public static final String REPAIR_RECORD_TYPE_TICKET = "ticket";
|
||||||
|
/**工单附属项目*/
|
||||||
|
public static final String REPAIR_RECORD_TYPE_REPAIR_ITEM = "repairItem";
|
||||||
|
/**维修记录*/
|
||||||
|
public static final String REPAIR_RECORD_TYPE_RECORD = "record";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,21 @@
|
|||||||
|
package cn.iocoder.yudao.module.custom.controller.admin;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.custom.service.UserCarService;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 用户车辆信息表--用户个人录入的")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/base/user-car")
|
||||||
|
@Validated
|
||||||
|
public class UserCarController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private UserCarService userCarService;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,119 @@
|
|||||||
|
package cn.iocoder.yudao.module.custom.entity;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户车辆信息表--用户个人录入的 DO
|
||||||
|
*
|
||||||
|
* @author vinjor-M
|
||||||
|
*/
|
||||||
|
@TableName("base_user_car")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class UserCar extends BaseDO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键标识
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.ASSIGN_UUID)
|
||||||
|
private String id;
|
||||||
|
/**
|
||||||
|
* 发动机号码
|
||||||
|
*/
|
||||||
|
private String engineNumber;
|
||||||
|
/**
|
||||||
|
* 车架号
|
||||||
|
*/
|
||||||
|
private String vin;
|
||||||
|
/**
|
||||||
|
* 车牌号
|
||||||
|
*/
|
||||||
|
private String licenseNumber;
|
||||||
|
/**
|
||||||
|
* 车辆品牌
|
||||||
|
*/
|
||||||
|
private String carBrand;
|
||||||
|
/**
|
||||||
|
* 车辆型号
|
||||||
|
*/
|
||||||
|
private String carModel;
|
||||||
|
/**
|
||||||
|
* 车辆性质:营运 非营运等
|
||||||
|
*/
|
||||||
|
private String carNature;
|
||||||
|
/**
|
||||||
|
* 车辆类别:私家车 货车 教练车 公务车 出租车
|
||||||
|
*/
|
||||||
|
private String carCategory;
|
||||||
|
/**
|
||||||
|
* 行驶证图片
|
||||||
|
*/
|
||||||
|
private String carLicenseImg;
|
||||||
|
/**
|
||||||
|
* 车辆注册日期
|
||||||
|
*/
|
||||||
|
private LocalDateTime carRegisterDate;
|
||||||
|
/**
|
||||||
|
* 保养日期
|
||||||
|
*/
|
||||||
|
private LocalDateTime maintenanceDate;
|
||||||
|
/**
|
||||||
|
* 保养里程
|
||||||
|
*/
|
||||||
|
private Long maintenanceMileage;
|
||||||
|
/**
|
||||||
|
* 年检日期
|
||||||
|
*/
|
||||||
|
private LocalDateTime inspectionDate;
|
||||||
|
/**
|
||||||
|
* 保险日期
|
||||||
|
*/
|
||||||
|
private LocalDateTime insuranceDate;
|
||||||
|
/**
|
||||||
|
* 二级维护时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime checkDate;
|
||||||
|
/**
|
||||||
|
* 下次保养日期
|
||||||
|
*/
|
||||||
|
private LocalDateTime nextMaintenanceDate;
|
||||||
|
/**
|
||||||
|
* 下次保养里程
|
||||||
|
*/
|
||||||
|
private Long nextMaintenanceMileage;
|
||||||
|
/**
|
||||||
|
* 下次年检日期
|
||||||
|
*/
|
||||||
|
private LocalDateTime nextInspectionDate;
|
||||||
|
/**
|
||||||
|
* 保险到期日期
|
||||||
|
*/
|
||||||
|
private LocalDateTime insuranceExpiryDate;
|
||||||
|
/**
|
||||||
|
* 下次二级维护时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime nextCheckDate;
|
||||||
|
/**
|
||||||
|
* 是否车主
|
||||||
|
*/
|
||||||
|
private String isOwner;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,16 @@
|
|||||||
|
package cn.iocoder.yudao.module.custom.mapper;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.custom.entity.UserCar;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户车辆信息表--用户个人录入的 Mapper
|
||||||
|
*
|
||||||
|
* @author vinjor-M
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface UserCarMapper extends BaseMapper<UserCar> {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
package cn.iocoder.yudao.module.custom.service;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.custom.entity.UserCar;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户车辆信息表--用户个人录入的 Service 接口
|
||||||
|
*
|
||||||
|
* @author vinjor-M
|
||||||
|
*/
|
||||||
|
public interface UserCarService extends IService<UserCar> {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
package cn.iocoder.yudao.module.custom.service.impl;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.custom.entity.UserCar;
|
||||||
|
import cn.iocoder.yudao.module.custom.mapper.UserCarMapper;
|
||||||
|
import cn.iocoder.yudao.module.custom.service.UserCarService;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户车辆信息表--用户个人录入的 Service 实现类
|
||||||
|
*
|
||||||
|
* @author vinjor-M
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class UserCarServiceImpl extends ServiceImpl<UserCarMapper, UserCar> implements UserCarService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private UserCarMapper userCarMapper;
|
||||||
|
}
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="cn.iocoder.yudao.module.custom.mapper.UserCarMapper">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||||
|
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||||
|
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||||
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
|
-->
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@ -1,21 +1,12 @@
|
|||||||
package cn.iocoder.yudao.module.base.controller.admin;
|
package cn.iocoder.yudao.module.base.controller.admin;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
||||||
import cn.iocoder.yudao.module.base.service.RepairRecordsService;
|
import cn.iocoder.yudao.module.base.service.RepairRecordsService;
|
||||||
import cn.iocoder.yudao.module.base.vo.RepairRecordsPageReqVO;
|
|
||||||
import cn.iocoder.yudao.module.base.vo.RepairRecordsRespVO;
|
|
||||||
import cn.iocoder.yudao.module.base.vo.RepairRecordsSaveReqVO;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import io.swagger.v3.oas.annotations.Parameter;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.validation.Valid;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 维修记录 管理 API
|
* 维修记录 管理 API
|
||||||
@ -30,43 +21,5 @@ public class RepairRecordsController {
|
|||||||
@Resource
|
@Resource
|
||||||
private RepairRecordsService repairRecordsService;
|
private RepairRecordsService repairRecordsService;
|
||||||
|
|
||||||
@PostMapping("/create")
|
|
||||||
@Operation(summary = "创建维修记录")
|
|
||||||
public CommonResult<String> createRepairRecords(@Valid @RequestBody RepairRecordsSaveReqVO createReqVO) {
|
|
||||||
return success(repairRecordsService.createRepairRecords(createReqVO));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PutMapping("/update")
|
|
||||||
@Operation(summary = "更新维修记录")
|
|
||||||
public CommonResult<Boolean> updateRepairRecords(@Valid @RequestBody RepairRecordsSaveReqVO updateReqVO) {
|
|
||||||
repairRecordsService.updateRepairRecords(updateReqVO);
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@DeleteMapping("/delete")
|
|
||||||
@Operation(summary = "删除维修记录")
|
|
||||||
@Parameter(name = "id", description = "编号", required = true)
|
|
||||||
public CommonResult<Boolean> deleteRepairRecords(@RequestParam("id") String id) {
|
|
||||||
repairRecordsService.deleteRepairRecords(id);
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
// @GetMapping("/get")
|
|
||||||
// @Operation(summary = "获得维修记录")
|
|
||||||
// @Parameter(name = "id", description = "编号", required = true, example = "1024")
|
|
||||||
// public CommonResult<RepairRecordsRespVO> getRecords(@RequestParam("id") String id) {
|
|
||||||
// RepairRecords records = repairRecordsService.getRepairRecords(id);
|
|
||||||
// return success(BeanUtils.toBean(records, RepairRecordsRespVO.class));
|
|
||||||
// }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 维修工查询维修记录
|
|
||||||
* @param pageReqVO
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
@GetMapping("/page")
|
|
||||||
@Operation(summary = "获得维修记录分页")
|
|
||||||
public List<RepairRecordsRespVO> queryAllRepairRecords(@RequestBody RepairRecordsPageReqVO pageReqVO) {
|
|
||||||
return repairRecordsService.queryAllRepairRecords(pageReqVO);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,7 +23,7 @@ public class RepairRecords extends TenantBaseDO {
|
|||||||
/**
|
/**
|
||||||
* 主键标识
|
* 主键标识
|
||||||
*/
|
*/
|
||||||
@TableId(type = IdType.INPUT)
|
@TableId(type = IdType.ASSIGN_UUID)
|
||||||
private String id;
|
private String id;
|
||||||
/**
|
/**
|
||||||
* 工单id
|
* 工单id
|
||||||
@ -32,7 +32,7 @@ public class RepairRecords extends TenantBaseDO {
|
|||||||
/**
|
/**
|
||||||
* 工单子表id
|
* 工单子表id
|
||||||
*/
|
*/
|
||||||
private String repairTitemId;
|
private String repairItemId;
|
||||||
/**
|
/**
|
||||||
* 记录类型(repair_records_type)
|
* 记录类型(repair_records_type)
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -0,0 +1,52 @@
|
|||||||
|
package cn.iocoder.yudao.module.base.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 lombok.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 维修记录附件
|
||||||
|
* @author pqz
|
||||||
|
*/
|
||||||
|
@TableName("dl_repair_records_item")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class RepairRecordsItem extends TenantBaseDO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键标识
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.ASSIGN_UUID)
|
||||||
|
private String id;
|
||||||
|
/**
|
||||||
|
* 记录id
|
||||||
|
*/
|
||||||
|
private String recordId;
|
||||||
|
/**
|
||||||
|
* 工单id
|
||||||
|
*/
|
||||||
|
private String ticketId;
|
||||||
|
/**
|
||||||
|
* 工单子表id
|
||||||
|
*/
|
||||||
|
private String repairItemId;
|
||||||
|
/**
|
||||||
|
* 记录描述
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
/**
|
||||||
|
* 图片附件
|
||||||
|
*/
|
||||||
|
private String image;
|
||||||
|
/**
|
||||||
|
* 是否开放给用户(0否1是)
|
||||||
|
*/
|
||||||
|
private String isOpen;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,16 @@
|
|||||||
|
package cn.iocoder.yudao.module.base.mapper;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.base.entity.RepairRecordsItem;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 维修记录 Mapper
|
||||||
|
*
|
||||||
|
* @author pqz
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface RepairRecordsItemMapper extends BaseMapper<RepairRecordsItem> {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -18,13 +18,5 @@ import java.util.List;
|
|||||||
public interface RepairRecordsMapper extends BaseMapper<RepairRecords> {
|
public interface RepairRecordsMapper extends BaseMapper<RepairRecords> {
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询维修记录
|
|
||||||
* @author lzt
|
|
||||||
* @param entity 查询条件
|
|
||||||
* @return List<RepairRecordsRespVO>
|
|
||||||
* @date 2024年10月9日
|
|
||||||
*/
|
|
||||||
List<RepairRecordsRespVO> queryAllRepairRecords(@Param("entity") RepairRecordsPageReqVO entity);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,23 @@
|
|||||||
|
package cn.iocoder.yudao.module.base.service;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.base.entity.RepairRecordsItem;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 维修记录 Service 接口
|
||||||
|
*
|
||||||
|
* @author pqz
|
||||||
|
*/
|
||||||
|
public interface RepairRecordsItemService extends IService<RepairRecordsItem> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据主表id删除附件
|
||||||
|
*
|
||||||
|
* @param mainType ticket:工单;repairItem:工单附属项目;record:维修记录
|
||||||
|
* @param mainId 主表id
|
||||||
|
* @author PQZ
|
||||||
|
* @date 11:43 2024/10/11
|
||||||
|
**/
|
||||||
|
void removeByMainId(String mainType, String mainId);
|
||||||
|
|
||||||
|
}
|
||||||
@ -21,42 +21,10 @@ public interface RepairRecordsService extends IService<RepairRecords> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建维修记录
|
* 创建维修记录
|
||||||
*
|
* @author PQZ
|
||||||
* @param createReqVO 创建信息
|
* @date 11:41 2024/10/11
|
||||||
* @return 编号
|
* @param saveReqVO RepairRecordsSaveReqVO实体
|
||||||
*/
|
**/
|
||||||
String createRepairRecords(@Valid RepairRecordsSaveReqVO createReqVO);
|
void saveRepairRecord(RepairRecordsSaveReqVO saveReqVO);
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新维修记录
|
|
||||||
*
|
|
||||||
* @param updateReqVO 更新信息
|
|
||||||
*/
|
|
||||||
void updateRepairRecords(@Valid RepairRecordsSaveReqVO updateReqVO);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除维修记录
|
|
||||||
*
|
|
||||||
* @param id 编号
|
|
||||||
*/
|
|
||||||
void deleteRepairRecords(String id);
|
|
||||||
|
|
||||||
// /**
|
|
||||||
// * 获得维修记录
|
|
||||||
// *
|
|
||||||
// * @param id 编号
|
|
||||||
// * @return 维修记录
|
|
||||||
// */
|
|
||||||
// RepairRecords getRepairRecords(String id);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获得维修记录
|
|
||||||
*
|
|
||||||
* @param pageReqVO 查询条件
|
|
||||||
* @return queryAllRepairRecords 所有维修记录
|
|
||||||
*/
|
|
||||||
List<RepairRecordsRespVO> queryAllRepairRecords(RepairRecordsPageReqVO pageReqVO);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,58 @@
|
|||||||
|
package cn.iocoder.yudao.module.base.service.impl;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
import cn.iocoder.yudao.module.base.entity.RepairRecordsItem;
|
||||||
|
import cn.iocoder.yudao.module.base.mapper.RepairRecordsItemMapper;
|
||||||
|
import cn.iocoder.yudao.module.base.service.RepairRecordsItemService;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.common.BaseConstants.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 维修记录 Service 实现类
|
||||||
|
*
|
||||||
|
* @author pqz
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class RepairRecordsItemServiceImpl extends ServiceImpl<RepairRecordsItemMapper, RepairRecordsItem> implements RepairRecordsItemService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private RepairRecordsItemMapper itemMapper;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据主表id删除附件
|
||||||
|
*
|
||||||
|
* @param mainType ticket:工单;repairItem:工单附属项目;record:维修记录
|
||||||
|
* @param mainId 主表id
|
||||||
|
* @author PQZ
|
||||||
|
* @date 11:43 2024/10/11
|
||||||
|
**/
|
||||||
|
@Override
|
||||||
|
public void removeByMainId(String mainType, String mainId) {
|
||||||
|
LambdaQueryWrapper<RepairRecordsItem> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
switch (mainType) {
|
||||||
|
//匹配根据工单表id删除条件
|
||||||
|
case REPAIR_RECORD_TYPE_TICKET:
|
||||||
|
lambdaQueryWrapper.eq(RepairRecordsItem::getTicketId, mainId);
|
||||||
|
break;
|
||||||
|
//匹配根据工单子表id删除条件
|
||||||
|
case REPAIR_RECORD_TYPE_REPAIR_ITEM:
|
||||||
|
lambdaQueryWrapper.eq(RepairRecordsItem::getRepairItemId,mainId);
|
||||||
|
break;
|
||||||
|
//匹配根据根据记录表id删除条件
|
||||||
|
case REPAIR_RECORD_TYPE_RECORD:
|
||||||
|
lambdaQueryWrapper.eq(RepairRecordsItem::getRecordId,mainId);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
remove(lambdaQueryWrapper);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,21 +1,14 @@
|
|||||||
package cn.iocoder.yudao.module.base.service.impl;
|
package cn.iocoder.yudao.module.base.service.impl;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
||||||
import cn.iocoder.yudao.module.base.entity.RepairRecords;
|
import cn.iocoder.yudao.module.base.entity.RepairRecords;
|
||||||
import cn.iocoder.yudao.module.base.mapper.RepairRecordsMapper;
|
import cn.iocoder.yudao.module.base.mapper.RepairRecordsMapper;
|
||||||
import cn.iocoder.yudao.module.base.service.RepairRecordsService;
|
import cn.iocoder.yudao.module.base.service.RepairRecordsService;
|
||||||
import cn.iocoder.yudao.module.base.vo.RepairRecordsPageReqVO;
|
|
||||||
import cn.iocoder.yudao.module.base.vo.RepairRecordsRespVO;
|
|
||||||
import cn.iocoder.yudao.module.base.vo.RepairRecordsSaveReqVO;
|
import cn.iocoder.yudao.module.base.vo.RepairRecordsSaveReqVO;
|
||||||
import cn.iocoder.yudao.module.base.vo.RepairWorkerPageReqVO;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 维修记录 Service 实现类
|
* 维修记录 Service 实现类
|
||||||
@ -29,45 +22,16 @@ public class RepairRecordsServiceImpl extends ServiceImpl<RepairRecordsMapper, R
|
|||||||
@Resource
|
@Resource
|
||||||
private RepairRecordsMapper repairRecordsMapper;
|
private RepairRecordsMapper repairRecordsMapper;
|
||||||
|
|
||||||
@Override
|
|
||||||
public String createRepairRecords(RepairRecordsSaveReqVO createReqVO) {
|
|
||||||
// 插入
|
|
||||||
RepairRecords records = BeanUtils.toBean(createReqVO, RepairRecords.class);
|
|
||||||
repairRecordsMapper.insert(records);
|
|
||||||
// 返回
|
|
||||||
return records.getId();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void updateRepairRecords(RepairRecordsSaveReqVO updateReqVO) {
|
|
||||||
// 更新
|
|
||||||
RepairRecords updateObj = BeanUtils.toBean(updateReqVO, RepairRecords.class);
|
|
||||||
repairRecordsMapper.updateById(updateObj);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void deleteRepairRecords(String id) {
|
|
||||||
// 删除
|
|
||||||
repairRecordsMapper.deleteById(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
// @Override
|
|
||||||
// public RepairRecords getRepairRecords(String id) {
|
|
||||||
// return repairRecordsMapper.selectById(id);
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询维修记录
|
* 创建维修记录
|
||||||
* @apiNote lzt
|
*
|
||||||
* @param pageReqVO 查询条件
|
* @param saveReqVO RepairRecordsSaveReqVO实体
|
||||||
* @return queryAllRepairRecords 所有维修记录
|
* @author PQZ
|
||||||
* @date 2024年10月9日
|
* @date 11:41 2024/10/11
|
||||||
*/
|
**/
|
||||||
@Override
|
@Override
|
||||||
public List<RepairRecordsRespVO> queryAllRepairRecords(RepairRecordsPageReqVO pageReqVO) {
|
public void saveRepairRecord(RepairRecordsSaveReqVO saveReqVO) {
|
||||||
return repairRecordsMapper.queryAllRepairRecords(pageReqVO);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,12 +1,20 @@
|
|||||||
package cn.iocoder.yudao.module.base.vo;
|
package cn.iocoder.yudao.module.base.vo;
|
||||||
|
|
||||||
import cn.iocoder.yudao.module.base.entity.RepairRecords;
|
import cn.iocoder.yudao.module.base.entity.RepairRecords;
|
||||||
|
import cn.iocoder.yudao.module.base.entity.RepairRecordsItem;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Schema(description = "管理后台 - 维修记录新增/修改 Request VO")
|
@Schema(description = "管理后台 - 维修记录新增/修改 Request VO")
|
||||||
@Data
|
@Data
|
||||||
public class RepairRecordsSaveReqVO extends RepairRecords {
|
public class RepairRecordsSaveReqVO extends RepairRecords {
|
||||||
|
|
||||||
|
/**维修记录附件表*/
|
||||||
|
List<RepairRecordsItem> itemList;
|
||||||
|
/**当前维修记录中需要保存的附件信息*/
|
||||||
|
String images;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="cn.iocoder.yudao.module.base.mapper.RepairRecordsItemMapper">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||||
|
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||||
|
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||||
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
|
-->
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@ -9,15 +9,6 @@
|
|||||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<select id="queryAllRepairRecords" resultType="cn.iocoder.yudao.module.base.vo.RepairRecordsRespVO">
|
|
||||||
SELECT *
|
|
||||||
FROM dl_repair_records
|
|
||||||
<where>
|
|
||||||
<if test="entity.someField != null">
|
|
||||||
AND some_column = #{entity.someField}
|
|
||||||
</if>
|
|
||||||
</where>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user