diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/controller/admin/RepairRecordsController.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/controller/admin/RepairRecordsController.java new file mode 100644 index 00000000..4ce74ca3 --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/controller/admin/RepairRecordsController.java @@ -0,0 +1,72 @@ +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.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 org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.validation.Valid; +import java.util.List; + +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; + +/** + * 维修记录 管理 API + * @author lzt + */ +@Tag(name = "管理后台 - 维修记录") +@RestController +@RequestMapping("/dl/repair-records") +@Validated +public class RepairRecordsController { + + @Resource + private RepairRecordsService repairRecordsService; + + @PostMapping("/create") + @Operation(summary = "创建维修记录") + public CommonResult createRepairRecords(@Valid @RequestBody RepairRecordsSaveReqVO createReqVO) { + return success(repairRecordsService.createRepairRecords(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新维修记录") + public CommonResult updateRepairRecords(@Valid @RequestBody RepairRecordsSaveReqVO updateReqVO) { + repairRecordsService.updateRepairRecords(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除维修记录") + @Parameter(name = "id", description = "编号", required = true) + public CommonResult 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 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 queryAllRepairRecords(@RequestBody RepairRecordsPageReqVO pageReqVO) { + return repairRecordsService.queryAllRepairRecords(pageReqVO); + } +} diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/entity/RepairRecords.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/entity/RepairRecords.java new file mode 100644 index 00000000..b93f6961 --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/entity/RepairRecords.java @@ -0,0 +1,57 @@ +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.*; + +/** + * 维修记录 DO + * + * @author lzt + */ +@TableName("dl_repair_records") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class RepairRecords extends TenantBaseDO { + + /** + * 主键标识 + */ + @TableId(type = IdType.INPUT) + private String id; + /** + * 工单id + */ + private String ticketId; + /** + * 工单子表id + */ + private String repairTitemId; + /** + * 记录类型(repair_records_type) + */ + private String type; + /** + * 记录描述 + */ + private String remark; + /** + * 过程记录中的图片(多个,拼接) + */ + private String image; + /** + * 处理人 + */ + private String dealUserName; + /** + * 处理人员工表id + */ + private String dealUserId; + +} diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/mapper/RepairRecordsMapper.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/mapper/RepairRecordsMapper.java new file mode 100644 index 00000000..72967e18 --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/mapper/RepairRecordsMapper.java @@ -0,0 +1,30 @@ +package cn.iocoder.yudao.module.base.mapper; + +import cn.iocoder.yudao.module.base.entity.RepairRecords; +import cn.iocoder.yudao.module.base.vo.RepairRecordsPageReqVO; +import cn.iocoder.yudao.module.base.vo.RepairRecordsRespVO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 维修记录 Mapper + * + * @author lzt + */ +@Mapper +public interface RepairRecordsMapper extends BaseMapper { + + + /** + * 查询维修记录 + * @author lzt + * @param entity 查询条件 + * @return List + * @date 2024年10月9日 + */ + List queryAllRepairRecords(@Param("entity") RepairRecordsPageReqVO entity); + +} diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/service/RepairRecordsService.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/service/RepairRecordsService.java new file mode 100644 index 00000000..5eeee7e5 --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/service/RepairRecordsService.java @@ -0,0 +1,60 @@ +package cn.iocoder.yudao.module.base.service; + +import cn.iocoder.yudao.module.base.entity.RepairRecords; +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.RepairWorkerPageReqVO; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; + +import javax.validation.Valid; +import java.util.List; + +/** + * 维修记录 Service 接口 + * + * @author lzt + */ +public interface RepairRecordsService extends IService { + + /** + * 创建维修记录 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + String createRepairRecords(@Valid RepairRecordsSaveReqVO createReqVO); + + /** + * 更新维修记录 + * + * @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 queryAllRepairRecords(RepairRecordsPageReqVO pageReqVO); + +} diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/service/RepairWorkerService.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/service/RepairWorkerService.java index fc2966df..34ab2fec 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/service/RepairWorkerService.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/service/RepairWorkerService.java @@ -1,12 +1,9 @@ package cn.iocoder.yudao.module.base.service; -import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.module.base.entity.RepairWorker; import cn.iocoder.yudao.module.base.vo.RepairWorkerPageReqVO; import cn.iocoder.yudao.module.base.vo.RepairWorkerRespVO; import cn.iocoder.yudao.module.base.vo.RepairWorkerSaveReqVO; -import cn.iocoder.yudao.module.project.vo.RepairProjectPageReqVO; -import cn.iocoder.yudao.module.project.vo.RepairProjectRespVO; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; @@ -60,4 +57,4 @@ public interface RepairWorkerService extends IService { **/ IPage queryListPage(RepairWorkerPageReqVO pageReqVO, Page page); -} \ No newline at end of file +} diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/service/impl/RepairRecordsServiceImpl.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/service/impl/RepairRecordsServiceImpl.java new file mode 100644 index 00000000..967b0b36 --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/service/impl/RepairRecordsServiceImpl.java @@ -0,0 +1,73 @@ +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.mapper.RepairRecordsMapper; +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.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 org.springframework.stereotype.Service; +import org.springframework.validation.annotation.Validated; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 维修记录 Service 实现类 + * + * @author lzt + */ +@Service +@Validated +public class RepairRecordsServiceImpl extends ServiceImpl implements RepairRecordsService { + + @Resource + 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 查询条件 + * @return queryAllRepairRecords 所有维修记录 + * @date + */ + @Override + public List queryAllRepairRecords(RepairRecordsPageReqVO pageReqVO) { + return repairRecordsMapper.queryAllRepairRecords(pageReqVO); + } + + +} diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/vo/RepairRecordsPageReqVO.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/vo/RepairRecordsPageReqVO.java new file mode 100644 index 00000000..f9d55f49 --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/vo/RepairRecordsPageReqVO.java @@ -0,0 +1,15 @@ +package cn.iocoder.yudao.module.base.vo; + +import cn.iocoder.yudao.module.base.entity.RepairRecords; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +@Schema(description = "接受维修记录的分页查询参数") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class RepairRecordsPageReqVO extends RepairRecords { + +} diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/vo/RepairRecordsRespVO.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/vo/RepairRecordsRespVO.java new file mode 100644 index 00000000..3228b872 --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/vo/RepairRecordsRespVO.java @@ -0,0 +1,13 @@ +package cn.iocoder.yudao.module.base.vo; + +import cn.iocoder.yudao.module.base.entity.RepairRecords; +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Schema(description = "管理后台 - 维修记录 Response VO") +@Data +@ExcelIgnoreUnannotated +public class RepairRecordsRespVO extends RepairRecords { + +} diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/vo/RepairRecordsSaveReqVO.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/vo/RepairRecordsSaveReqVO.java new file mode 100644 index 00000000..6cbdda8d --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/vo/RepairRecordsSaveReqVO.java @@ -0,0 +1,12 @@ +package cn.iocoder.yudao.module.base.vo; + +import cn.iocoder.yudao.module.base.entity.RepairRecords; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Schema(description = "管理后台 - 维修记录新增/修改 Request VO") +@Data +public class RepairRecordsSaveReqVO extends RepairRecords { + + +} diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/vo/RepairWorkerPageReqVO.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/vo/RepairWorkerPageReqVO.java index 7c851264..80addd3b 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/vo/RepairWorkerPageReqVO.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/vo/RepairWorkerPageReqVO.java @@ -6,11 +6,11 @@ import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; -@Schema(description = "接受分页查询参数") +@Schema(description = "接受页数查询参数") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class RepairWorkerPageReqVO extends RepairWorker { -} \ No newline at end of file +} diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/vo/RepairWorkerRespVO.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/vo/RepairWorkerRespVO.java index fc5bcb42..cf02492d 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/vo/RepairWorkerRespVO.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/vo/RepairWorkerRespVO.java @@ -1,10 +1,9 @@ package cn.iocoder.yudao.module.base.vo; import cn.iocoder.yudao.module.base.entity.RepairWorker; +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; -import java.util.*; -import com.alibaba.excel.annotation.*; +import lombok.Data; @Schema(description = "管理后台 - 维修工人 Response VO") @Data @@ -13,4 +12,4 @@ public class RepairWorkerRespVO extends RepairWorker { -} \ No newline at end of file +} diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/vo/RepairWorkerSaveReqVO.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/vo/RepairWorkerSaveReqVO.java index a929ad15..be6b07a2 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/vo/RepairWorkerSaveReqVO.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/vo/RepairWorkerSaveReqVO.java @@ -2,9 +2,7 @@ package cn.iocoder.yudao.module.base.vo; import cn.iocoder.yudao.module.base.entity.RepairWorker; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; -import java.util.*; -import javax.validation.constraints.*; +import lombok.Data; @Schema(description = "管理后台 - 维修工人新增/修改 Request VO") @Data @@ -12,4 +10,4 @@ public class RepairWorkerSaveReqVO extends RepairWorker { -} \ No newline at end of file +} diff --git a/dl-module-repair/src/main/resources/mapper/base/RepairRecordsMapper.xml b/dl-module-repair/src/main/resources/mapper/base/RepairRecordsMapper.xml new file mode 100644 index 00000000..b205d10e --- /dev/null +++ b/dl-module-repair/src/main/resources/mapper/base/RepairRecordsMapper.xml @@ -0,0 +1,23 @@ + + + + + + + + + +