diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CustomerMainServiceImpl.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CustomerMainServiceImpl.java index 94c1e49d..9e3dce3a 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CustomerMainServiceImpl.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CustomerMainServiceImpl.java @@ -108,6 +108,7 @@ public class CustomerMainServiceImpl extends ServiceImpl pageNotice(DlBaseNoticeReqVO reqVO, + @RequestParam(value = "pageNo", defaultValue = "1")Integer pageNo, + @RequestParam(value = "pageSize", defaultValue = "10")Integer pageSize) { + Page page = new Page<>(pageNo, pageSize); + return success(dlBaseNoticeService.pageNotice(reqVO, page)); + } + + /** + * 平台通用信息公告 新增、修改 按服务 + * + * @author 小李 + * @date 10:04 2024/10/9 + * @param reqVO 请求对象 + **/ + @PostMapping("/update") + @Operation(summary = "平台通用信息公告 新增、修改 按服务") + public CommonResult updateNotice(@RequestBody DlBaseNoticeReqVO reqVO) { + dlBaseNoticeService.updateNotice(reqVO); + return CommonResult.ok(); + } + + /** + * 平台通用信息公告 删除 按服务 + * + * @author 小李 + * @date 10:10 2024/10/9 + * @param ids ids + **/ + @DeleteMapping("/remove") + @Operation(summary = "平台通用信息公告 删除 按服务") + public CommonResult removeNotice(@RequestParam("ids") List ids) { + dlBaseNoticeService.removeNotice(ids); + return CommonResult.ok(); + } + + @GetMapping("get") + @Operation(summary = "平台通用信息公告 查询 按服务") + public CommonResult getNoticeById(@RequestParam("id") String id) { + return success(dlBaseNoticeService.getById(id)); + } +} + diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/notice/entity/DlBaseNotice.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/notice/entity/DlBaseNotice.java new file mode 100644 index 00000000..7afcb0c2 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/notice/entity/DlBaseNotice.java @@ -0,0 +1,53 @@ +package cn.iocoder.yudao.module.notice.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.Data; +import lombok.EqualsAndHashCode; + +/** + * 平台通用信息公告 + * + * @author 小李 + * @date 9:41 2024/10/9 +**/ +@TableName(value ="dl_base_notice") +@Data +@EqualsAndHashCode(callSuper = true) +public class DlBaseNotice extends TenantBaseDO { + /** + * 公告ID + */ + @TableId(type = IdType.ASSIGN_UUID) + private String id; + + /** + * 公告标题 + */ + private String title; + + /** + * 公告内容 + */ + private String content; + + /** + * 公告类型(1通知 2公告) + */ + private Integer type; + + /** + * 公告状态(0正常 1关闭) + */ + private Integer status; + + /** 父服务(服务拼音,例:维修业务即weixiu) */ + private String parentServer; + + /** + * 展示在那个服务(使用端,例:小程序即wx,APP即app) + */ + private String server; +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/notice/mapper/DlBaseNoticeMapper.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/notice/mapper/DlBaseNoticeMapper.java new file mode 100644 index 00000000..2c1157e4 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/notice/mapper/DlBaseNoticeMapper.java @@ -0,0 +1,32 @@ +package cn.iocoder.yudao.module.notice.mapper; + +import cn.iocoder.yudao.module.notice.entity.DlBaseNotice; +import cn.iocoder.yudao.module.notice.vo.DlBaseNoticeReqVO; +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.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 针对表【dl_base_notice(平台通用信息公告)】的数据库操作Mapper + * + * @author 小李 + * @date 9:44 2024/10/9 +**/ +@Mapper +public interface DlBaseNoticeMapper extends BaseMapper { + + /** + * 平台通用信息公告 分页查询 按服务 + * + * @author 小李 + * @date 9:52 2024/10/9 + * @param reqVO 查询对象 + **/ + IPage pageNotice(@Param("map") DlBaseNoticeReqVO reqVO, Page page); +} + + + + diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/notice/service/DlBaseNoticeService.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/notice/service/DlBaseNoticeService.java new file mode 100644 index 00000000..aa18ae3d --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/notice/service/DlBaseNoticeService.java @@ -0,0 +1,45 @@ +package cn.iocoder.yudao.module.notice.service; + +import cn.iocoder.yudao.module.notice.entity.DlBaseNotice; +import cn.iocoder.yudao.module.notice.vo.DlBaseNoticeReqVO; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; + +/** + * 针对表【dl_base_notice(平台通用信息公告)】的数据库操作Service + * + * @author 小李 + * @date 9:45 2024/10/9 +**/ +public interface DlBaseNoticeService extends IService { + + /** + * 平台通用信息公告 分页查询 按服务 + * + * @author 小李 + * @date 9:52 2024/10/9 + * @param reqVO 查询对象 + **/ + IPage pageNotice(DlBaseNoticeReqVO reqVO, Page page); + + /** + * 平台通用信息公告 新增、修改 按服务 + * + * @author 小李 + * @date 10:04 2024/10/9 + * @param reqVO 请求对象 + **/ + void updateNotice(DlBaseNoticeReqVO reqVO); + + /** + * 平台通用信息公告 删除 按服务 + * + * @author 小李 + * @date 10:10 2024/10/9 + * @param ids ids + **/ + void removeNotice(List ids); +} diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/notice/service/impl/DlBaseNoticeServiceImpl.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/notice/service/impl/DlBaseNoticeServiceImpl.java new file mode 100644 index 00000000..0121b06b --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/notice/service/impl/DlBaseNoticeServiceImpl.java @@ -0,0 +1,65 @@ +package cn.iocoder.yudao.module.notice.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import cn.iocoder.yudao.module.notice.entity.DlBaseNotice; +import cn.iocoder.yudao.module.notice.mapper.DlBaseNoticeMapper; +import cn.iocoder.yudao.module.notice.service.DlBaseNoticeService; +import cn.iocoder.yudao.module.notice.vo.DlBaseNoticeReqVO; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +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 java.util.List; + +/** + * 针对表【dl_base_notice(平台通用信息公告)】的数据库操作Service实现 + * + * @author 小李 + * @date 9:45 2024/10/9 +**/ +@Service +public class DlBaseNoticeServiceImpl extends ServiceImpl + implements DlBaseNoticeService { + + /** + * 平台通用信息公告 分页查询 按服务 + * + * @author 小李 + * @date 9:52 2024/10/9 + * @param reqVO 查询对象 + **/ + @Override + public IPage pageNotice(DlBaseNoticeReqVO reqVO, Page page){ + return baseMapper.pageNotice(reqVO, page); + } + + /** + * 平台通用信息公告 新增、修改 按服务 + * + * @author 小李 + * @date 10:04 2024/10/9 + * @param reqVO 请求对象 + **/ + @Override + public void updateNotice(DlBaseNoticeReqVO reqVO){ + baseMapper.insertOrUpdate(reqVO); + } + + /** + * 平台通用信息公告 删除 按服务 + * + * @author 小李 + * @date 10:10 2024/10/9 + * @param ids ids + **/ + @Override + public void removeNotice(List ids){ + baseMapper.deleteByIds(ids); + } +} + + + + diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/notice/vo/DlBaseNoticeReqVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/notice/vo/DlBaseNoticeReqVO.java new file mode 100644 index 00000000..fcfb4cd3 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/notice/vo/DlBaseNoticeReqVO.java @@ -0,0 +1,14 @@ +package cn.iocoder.yudao.module.notice.vo; + +import cn.iocoder.yudao.module.notice.entity.DlBaseNotice; +import lombok.Data; + +/** + * 平台通用信息公告 请求VO + * + * @author 小李 + * @date 9:43 2024/10/9 +**/ +@Data +public class DlBaseNoticeReqVO extends DlBaseNotice { +} diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/notice/vo/DlBaseNoticeRespVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/notice/vo/DlBaseNoticeRespVO.java new file mode 100644 index 00000000..f1aa1723 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/notice/vo/DlBaseNoticeRespVO.java @@ -0,0 +1,14 @@ +package cn.iocoder.yudao.module.notice.vo; + +import cn.iocoder.yudao.module.notice.entity.DlBaseNotice; +import lombok.Data; + +/** + * 平台通用信息公告 响应VO + * + * @author 小李 + * @date 9:43 2024/10/9 +**/ +@Data +public class DlBaseNoticeRespVO extends DlBaseNotice { +} diff --git a/dl-module-base/src/main/resources/mapper/notice/DlBaseNoticeMapper.xml b/dl-module-base/src/main/resources/mapper/notice/DlBaseNoticeMapper.xml new file mode 100644 index 00000000..02e19db8 --- /dev/null +++ b/dl-module-base/src/main/resources/mapper/notice/DlBaseNoticeMapper.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + select id, + title, + content, + type, + status, + parent_server, + server + from dl_base_notice dbn + where dbn.deleted = '0' + + + + 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/controller/admin/RepairWorkerController.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/controller/admin/RepairWorkerController.java new file mode 100644 index 00000000..60a0108e --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/controller/admin/RepairWorkerController.java @@ -0,0 +1,80 @@ +package cn.iocoder.yudao.module.base.controller.admin; + +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import cn.iocoder.yudao.module.base.entity.RepairWorker; +import cn.iocoder.yudao.module.base.service.RepairWorkerService; +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 com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +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 static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; + +@Tag(name = "管理后台 - 维修工人") +@RestController +@RequestMapping("/repair/worker") +@Validated +public class RepairWorkerController { + + @Resource + private RepairWorkerService workerService; + + @PostMapping("/create") + @Operation(summary = "创建维修工人") + public CommonResult createWorker(@Valid @RequestBody RepairWorkerSaveReqVO createReqVO) { + return success(workerService.createWorker(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新维修工人") + public CommonResult updateWorker(@Valid @RequestBody RepairWorkerSaveReqVO updateReqVO) { + workerService.updateWorker(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除维修工人") + @Parameter(name = "id", description = "编号", required = true) + public CommonResult deleteWorker(@RequestParam("id") String id) { + workerService.deleteWorker(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得维修工人") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + public CommonResult getWorker(@RequestParam("id") String id) { + RepairWorker worker = workerService.getWorker(id); + return success(BeanUtils.toBean(worker, RepairWorkerRespVO.class)); + } + + /** + * 分页查询维修工人 + * @author PQZ + * @date 14:10 2024/10/9 + * @param pageReqVO RepairWorkerPageReqVO实体 + * @return cn.iocoder.yudao.framework.common.pojo.CommonResult> + **/ + @GetMapping("/page") + @Operation(summary = "获得维修工人分页") + public CommonResult> getWorkerPage(RepairWorkerPageReqVO pageReqVO, + @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { + Page page = new Page<>(pageNo,pageSize); + return success(workerService.queryListPage(pageReqVO,page)); + } + + +} \ No newline at end of file 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/entity/RepairWorker.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/entity/RepairWorker.java new file mode 100644 index 00000000..2bf5c02a --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/entity/RepairWorker.java @@ -0,0 +1,49 @@ +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 pqz + */ +@TableName("dl_repair_worker") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class RepairWorker extends TenantBaseDO { + + /** + * 主键标识 + */ + @TableId(type = IdType.ASSIGN_UUID) + private String id; + /** + * 用户id + */ + private String userId; + /** + * 维修工人名称 + */ + private String userName; + /** + * 工种 + */ + private String workType; + /** + * 是否为组长(0代表不是 1代表是) + */ + private String isLeads; + /** + * 备注 + */ + private String remark; + +} \ No newline at end of file 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/mapper/RepairWorkerMapper.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/mapper/RepairWorkerMapper.java new file mode 100644 index 00000000..9ab4ea7a --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/mapper/RepairWorkerMapper.java @@ -0,0 +1,29 @@ +package cn.iocoder.yudao.module.base.mapper; + +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 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.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 维修工人 Mapper + * + * @author pqz + */ +@Mapper +public interface RepairWorkerMapper extends BaseMapper { + + /** + * @param entity RepairWorkerPageReqVO实体 + * @param page 分页参数 + * @return com.baomidou.mybatisplus.core.metadata.IPage + * @author PQZ + * @date 14:13 2024/10/9 + **/ + IPage queryListPage(@Param("entity") RepairWorkerPageReqVO entity, Page page); + +} \ No newline at end of file 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 new file mode 100644 index 00000000..34ab2fec --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/service/RepairWorkerService.java @@ -0,0 +1,60 @@ +package cn.iocoder.yudao.module.base.service; + +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 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; + +/** + * 维修工人 Service 接口 + * + * @author pqz + */ +public interface RepairWorkerService extends IService { + + /** + * 创建维修工人 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + String createWorker(@Valid RepairWorkerSaveReqVO createReqVO); + + /** + * 更新维修工人 + * + * @param updateReqVO 更新信息 + */ + void updateWorker(@Valid RepairWorkerSaveReqVO updateReqVO); + + /** + * 删除维修工人 + * + * @param id 编号 + */ + void deleteWorker(String id); + + /** + * 获得维修工人 + * + * @param id 编号 + * @return 维修工人 + */ + RepairWorker getWorker(String id); + + + /** + * @param pageReqVO RepairWorkerPageReqVO实体 + * @param page 分页参数 + * @return com.baomidou.mybatisplus.core.metadata.IPage + * @author PQZ + * @date 14:12 2024/10/9 + **/ + IPage queryListPage(RepairWorkerPageReqVO pageReqVO, Page page); + +} 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/service/impl/RepairWorkerServiceImpl.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/service/impl/RepairWorkerServiceImpl.java new file mode 100644 index 00000000..809aefd9 --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/service/impl/RepairWorkerServiceImpl.java @@ -0,0 +1,70 @@ +package cn.iocoder.yudao.module.base.service.impl; + +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import cn.iocoder.yudao.module.base.entity.RepairWorker; +import cn.iocoder.yudao.module.base.mapper.RepairWorkerMapper; +import cn.iocoder.yudao.module.base.service.RepairWorkerService; +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 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; + +/** + * 维修工人 Service 实现类 + * + * @author pqz + */ +@Service +@Validated +public class RepairWorkerServiceImpl extends ServiceImpl implements RepairWorkerService { + + @Resource + private RepairWorkerMapper workerMapper; + + @Override + public String createWorker(RepairWorkerSaveReqVO createReqVO) { + // 插入 + RepairWorker worker = BeanUtils.toBean(createReqVO, RepairWorker.class); + workerMapper.insert(worker); + // 返回 + return worker.getId(); + } + + @Override + public void updateWorker(RepairWorkerSaveReqVO updateReqVO) { + // 更新 + RepairWorker updateObj = BeanUtils.toBean(updateReqVO, RepairWorker.class); + workerMapper.updateById(updateObj); + } + + @Override + public void deleteWorker(String id) { + // 删除 + workerMapper.deleteById(id); + } + + + @Override + public RepairWorker getWorker(String id) { + return workerMapper.selectById(id); + } + + /** + * @param pageReqVO RepairWorkerPageReqVO实体 + * @param page 分页参数 + * @return com.baomidou.mybatisplus.core.metadata.IPage + * @author PQZ + * @date 14:12 2024/10/9 + **/ + @Override + public IPage queryListPage(RepairWorkerPageReqVO pageReqVO, Page page) { + return workerMapper.queryListPage(pageReqVO,page); + } + +} \ No newline at end of file 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 new file mode 100644 index 00000000..80addd3b --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/vo/RepairWorkerPageReqVO.java @@ -0,0 +1,16 @@ +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.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +@Schema(description = "接受页数查询参数") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class RepairWorkerPageReqVO extends RepairWorker { + + +} 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 new file mode 100644 index 00000000..cf02492d --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/vo/RepairWorkerRespVO.java @@ -0,0 +1,15 @@ +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.Data; + +@Schema(description = "管理后台 - 维修工人 Response VO") +@Data +@ExcelIgnoreUnannotated +public class RepairWorkerRespVO extends RepairWorker { + + + +} 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 new file mode 100644 index 00000000..be6b07a2 --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/vo/RepairWorkerSaveReqVO.java @@ -0,0 +1,13 @@ +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.Data; + +@Schema(description = "管理后台 - 维修工人新增/修改 Request VO") +@Data +public class RepairWorkerSaveReqVO extends RepairWorker { + + + +} diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/controller/admin/RepairProjectController.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/controller/admin/RepairProjectController.java index 07dc3013..c2874b70 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/controller/admin/RepairProjectController.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/controller/admin/RepairProjectController.java @@ -44,7 +44,6 @@ public class RepairProjectController { **/ @PostMapping("/create") @Operation(summary = "创建维修项目") -// @PreAuthorize("@ss.hasPermission('repair:project:create')") public CommonResult createRepairProject(@Valid @RequestBody RepairProjectSaveReqVO createReqVO) { RepairProject repairProject = repairProjectService.saveRepairProject(createReqVO); return success(repairProject); @@ -60,7 +59,6 @@ public class RepairProjectController { **/ @PutMapping("/update") @Operation(summary = "更新维修项目") -// @PreAuthorize("@ss.hasPermission('repair:project:update')") public CommonResult updateRepairProject(@Valid @RequestBody RepairProjectSaveReqVO updateReqVO) { repairProjectService.saveRepairProject(updateReqVO); return success(true); @@ -77,7 +75,6 @@ public class RepairProjectController { @DeleteMapping("/delete") @Operation(summary = "删除维修项目") @Parameter(name = "id", description = "编号", required = true) -// @PreAuthorize("@ss.hasPermission('repair:project:delete')") public CommonResult deleteRepairProject(@RequestParam("id") String id) { repairProjectService.deleteRepairProject(id); return success(true); @@ -94,7 +91,6 @@ public class RepairProjectController { @GetMapping("/get") @Operation(summary = "获得维修项目") @Parameter(name = "id", description = "编号", required = true, example = "1024") -// @PreAuthorize("@ss.hasPermission('repair:project:query')") public CommonResult getRepairProject(@RequestParam("id") String id) { RepairProject repairProject = repairProjectService.getRepairProject(id); return success(BeanUtils.toBean(repairProject, RepairProjectRespVO.class)); @@ -113,7 +109,6 @@ public class RepairProjectController { **/ @GetMapping("/page") @Operation(summary = "获得维修项目分页") -// @PreAuthorize("@ss.hasPermission('repair:project:query')") public CommonResult> getRepairProjectPage(RepairProjectPageReqVO pageReqVO, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { 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 @@ + + + + + + + + + + diff --git a/dl-module-repair/src/main/resources/mapper/base/RepairWorkerMapper.xml b/dl-module-repair/src/main/resources/mapper/base/RepairWorkerMapper.xml new file mode 100644 index 00000000..9deb9ab3 --- /dev/null +++ b/dl-module-repair/src/main/resources/mapper/base/RepairWorkerMapper.xml @@ -0,0 +1,27 @@ + + + + + + + + \ No newline at end of file