From a9e42464e47e743a75aca3a3bb130f6ee4df54f8 Mon Sep 17 00:00:00 2001 From: yanhuiqinghot Date: Sun, 30 Nov 2025 22:52:37 +0800 Subject: [PATCH] 工单管理代码提交 --- pom.xml | 1 + urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/attachment/AttachmentController.java | 104 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/attachment/vo/AttachmentPageReqVO.java | 44 ++++++++++++++++++++++++++++++++++++++++++++ urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/attachment/vo/AttachmentRespVO.java | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/attachment/vo/AttachmentSaveReqVO.java | 43 +++++++++++++++++++++++++++++++++++++++++++ urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/maininfo/MainInfoController.java | 104 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/maininfo/vo/MainInfoPageReqVO.java | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/maininfo/vo/MainInfoRespVO.java | 128 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/maininfo/vo/MainInfoSaveReqVO.java | 116 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/materialdetail/MaterialDetailController.java | 104 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/materialdetail/vo/MaterialDetailPageReqVO.java | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/materialdetail/vo/MaterialDetailRespVO.java | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/materialdetail/vo/MaterialDetailSaveReqVO.java | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/dataobject/attachment/AttachmentDO.java | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/dataobject/maininfo/MainInfoDO.java | 139 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/dataobject/materialdetail/MaterialDetailDO.java | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/mysql/attachment/AttachmentMapper.java | 34 ++++++++++++++++++++++++++++++++++ urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/mysql/maininfo/MainInfoMapper.java | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/mysql/materialdetail/MaterialDetailMapper.java | 39 +++++++++++++++++++++++++++++++++++++++ urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/enums/ErrorCodeConstants.java | 19 +++++++++++++++++++ urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/attachment/AttachmentService.java | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/attachment/AttachmentServiceImpl.java | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/maininfo/MainInfoService.java | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/maininfo/MainInfoServiceImpl.java | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/materialdetail/MaterialDetailService.java | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/materialdetail/MaterialDetailServiceImpl.java | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ urbanops-module-workorder/src/main/resources/mapper/maininfo/MainInfoMapper.xml | 12 ++++++++++++ urbanops-module-workorder/src/main/resources/mapper/mapper/attachment/AttachmentMapper.xml | 12 ++++++++++++ urbanops-module-workorder/src/main/resources/mapper/materialdetail/MaterialDetailMapper.xml | 12 ++++++++++++ urbanops-server/pom.xml | 7 +++++++ 30 files changed, 1914 insertions(+), 0 deletions(-) create mode 100644 urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/attachment/AttachmentController.java create mode 100644 urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/attachment/vo/AttachmentPageReqVO.java create mode 100644 urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/attachment/vo/AttachmentRespVO.java create mode 100644 urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/attachment/vo/AttachmentSaveReqVO.java create mode 100644 urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/maininfo/MainInfoController.java create mode 100644 urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/maininfo/vo/MainInfoPageReqVO.java create mode 100644 urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/maininfo/vo/MainInfoRespVO.java create mode 100644 urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/maininfo/vo/MainInfoSaveReqVO.java create mode 100644 urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/materialdetail/MaterialDetailController.java create mode 100644 urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/materialdetail/vo/MaterialDetailPageReqVO.java create mode 100644 urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/materialdetail/vo/MaterialDetailRespVO.java create mode 100644 urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/materialdetail/vo/MaterialDetailSaveReqVO.java create mode 100644 urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/dataobject/attachment/AttachmentDO.java create mode 100644 urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/dataobject/maininfo/MainInfoDO.java create mode 100644 urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/dataobject/materialdetail/MaterialDetailDO.java create mode 100644 urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/mysql/attachment/AttachmentMapper.java create mode 100644 urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/mysql/maininfo/MainInfoMapper.java create mode 100644 urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/mysql/materialdetail/MaterialDetailMapper.java create mode 100644 urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/enums/ErrorCodeConstants.java create mode 100644 urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/attachment/AttachmentService.java create mode 100644 urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/attachment/AttachmentServiceImpl.java create mode 100644 urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/maininfo/MainInfoService.java create mode 100644 urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/maininfo/MainInfoServiceImpl.java create mode 100644 urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/materialdetail/MaterialDetailService.java create mode 100644 urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/materialdetail/MaterialDetailServiceImpl.java create mode 100644 urbanops-module-workorder/src/main/resources/mapper/maininfo/MainInfoMapper.xml create mode 100644 urbanops-module-workorder/src/main/resources/mapper/mapper/attachment/AttachmentMapper.xml create mode 100644 urbanops-module-workorder/src/main/resources/mapper/materialdetail/MaterialDetailMapper.xml diff --git a/pom.xml b/pom.xml index 4cb1c6e..2c64f7c 100644 --- a/pom.xml +++ b/pom.xml @@ -17,6 +17,7 @@ urbanops-module-infra urbanops-module-gloabl urbanops-module-garden + urbanops-module-workorder urbanops-module-bpm diff --git a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/attachment/AttachmentController.java b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/attachment/AttachmentController.java new file mode 100644 index 0000000..1c21434 --- /dev/null +++ b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/attachment/AttachmentController.java @@ -0,0 +1,104 @@ +package com.zteits.urbanops.module.workorder.controller.admin.attachment; + +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import jakarta.validation.constraints.*; +import jakarta.validation.*; +import jakarta.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.zteits.urbanops.framework.common.pojo.PageParam; +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.common.pojo.CommonResult; +import com.zteits.urbanops.framework.common.util.object.BeanUtils; +import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; + +import com.zteits.urbanops.framework.excel.core.util.ExcelUtils; + +import com.zteits.urbanops.framework.apilog.core.annotation.ApiAccessLog; +import static com.zteits.urbanops.framework.apilog.core.enums.OperateTypeEnum.*; + +import com.zteits.urbanops.module.workorder.controller.admin.attachment.vo.*; +import com.zteits.urbanops.module.workorder.dal.dataobject.attachment.AttachmentDO; +import com.zteits.urbanops.module.workorder.service.attachment.AttachmentService; + +@Tag(name = "管理后台 - 工单附件信息") +@RestController +@RequestMapping("/workorder/attachment") +@Validated +public class AttachmentController { + + @Resource + private AttachmentService attachmentService; + + @PostMapping("/create") + @Operation(summary = "创建工单附件信息") + @PreAuthorize("@ss.hasPermission('workorder:attachment:create')") + public CommonResult createAttachment(@Valid @RequestBody AttachmentSaveReqVO createReqVO) { + return success(attachmentService.createAttachment(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新工单附件信息") + @PreAuthorize("@ss.hasPermission('workorder:attachment:update')") + public CommonResult updateAttachment(@Valid @RequestBody AttachmentSaveReqVO updateReqVO) { + attachmentService.updateAttachment(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除工单附件信息") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('workorder:attachment:delete')") + public CommonResult deleteAttachment(@RequestParam("id") Long id) { + attachmentService.deleteAttachment(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除工单附件信息") + @PreAuthorize("@ss.hasPermission('workorder:attachment:delete')") + public CommonResult deleteAttachmentList(@RequestParam("ids") List ids) { + attachmentService.deleteAttachmentListByIds(ids); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得工单附件信息") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('workorder:attachment:query')") + public CommonResult getAttachment(@RequestParam("id") Long id) { + AttachmentDO attachment = attachmentService.getAttachment(id); + return success(BeanUtils.toBean(attachment, AttachmentRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得工单附件信息分页") + @PreAuthorize("@ss.hasPermission('workorder:attachment:query')") + public CommonResult> getAttachmentPage(@Valid AttachmentPageReqVO pageReqVO) { + PageResult pageResult = attachmentService.getAttachmentPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, AttachmentRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出工单附件信息 Excel") + @PreAuthorize("@ss.hasPermission('workorder:attachment:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportAttachmentExcel(@Valid AttachmentPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = attachmentService.getAttachmentPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "工单附件信息.xls", "数据", AttachmentRespVO.class, + BeanUtils.toBean(list, AttachmentRespVO.class)); + } + +} \ No newline at end of file diff --git a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/attachment/vo/AttachmentPageReqVO.java b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/attachment/vo/AttachmentPageReqVO.java new file mode 100644 index 0000000..e6090c3 --- /dev/null +++ b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/attachment/vo/AttachmentPageReqVO.java @@ -0,0 +1,44 @@ +package com.zteits.urbanops.module.workorder.controller.admin.attachment.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zteits.urbanops.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 工单附件信息分页 Request VO") +@Data +public class AttachmentPageReqVO extends PageParam { + + @Schema(description = "工单号") + private String orderNo; + + @Schema(description = "业务线:yl 园林,wy 物业,sz 市政 ") + private String busiLine; + + @Schema(description = "业务类型:01 问题图片,02 街道图片,03 选景图片", example = "1") + private String busiType; + + @Schema(description = "文件名称") + private String fileNames; + + @Schema(description = "路径", example = "https://www.iocoder.cn") + private String hostUrl; + + @Schema(description = "文件大小") + private String fileSize; + + @Schema(description = "文件类型", example = "2") + private String contentType; + + @Schema(description = "描述", example = "你说的对") + private String remark; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/attachment/vo/AttachmentRespVO.java b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/attachment/vo/AttachmentRespVO.java new file mode 100644 index 0000000..bc76c6e --- /dev/null +++ b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/attachment/vo/AttachmentRespVO.java @@ -0,0 +1,55 @@ +package com.zteits.urbanops.module.workorder.controller.admin.attachment.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import cn.idev.excel.annotation.*; + +@Schema(description = "管理后台 - 工单附件信息 Response VO") +@Data +@ExcelIgnoreUnannotated +public class AttachmentRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4728") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "工单号", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("工单号") + private String orderNo; + + @Schema(description = "业务线:yl 园林,wy 物业,sz 市政 ", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("业务线:yl 园林,wy 物业,sz 市政 ") + private String busiLine; + + @Schema(description = "业务类型:01 问题图片,02 街道图片,03 选景图片", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @ExcelProperty("业务类型:01 问题图片,02 街道图片,03 选景图片") + private String busiType; + + @Schema(description = "文件名称") + @ExcelProperty("文件名称") + private String fileNames; + + @Schema(description = "路径", example = "https://www.iocoder.cn") + @ExcelProperty("路径") + private String hostUrl; + + @Schema(description = "文件大小") + @ExcelProperty("文件大小") + private String fileSize; + + @Schema(description = "文件类型", example = "2") + @ExcelProperty("文件类型") + private String contentType; + + @Schema(description = "描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "你说的对") + @ExcelProperty("描述") + private String remark; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/attachment/vo/AttachmentSaveReqVO.java b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/attachment/vo/AttachmentSaveReqVO.java new file mode 100644 index 0000000..101d017 --- /dev/null +++ b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/attachment/vo/AttachmentSaveReqVO.java @@ -0,0 +1,43 @@ +package com.zteits.urbanops.module.workorder.controller.admin.attachment.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; + +@Schema(description = "管理后台 - 工单附件信息新增/修改 Request VO") +@Data +public class AttachmentSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4728") + private Long id; + + @Schema(description = "工单号", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "工单号不能为空") + private String orderNo; + + @Schema(description = "业务线:yl 园林,wy 物业,sz 市政 ", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "业务线:yl 园林,wy 物业,sz 市政 不能为空") + private String busiLine; + + @Schema(description = "业务类型:01 问题图片,02 街道图片,03 选景图片", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @NotEmpty(message = "业务类型:01 问题图片,02 街道图片,03 选景图片不能为空") + private String busiType; + + @Schema(description = "文件名称") + private String fileNames; + + @Schema(description = "路径", example = "https://www.iocoder.cn") + private String hostUrl; + + @Schema(description = "文件大小") + private String fileSize; + + @Schema(description = "文件类型", example = "2") + private String contentType; + + @Schema(description = "描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "你说的对") + @NotEmpty(message = "描述不能为空") + private String remark; + +} \ No newline at end of file diff --git a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/maininfo/MainInfoController.java b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/maininfo/MainInfoController.java new file mode 100644 index 0000000..32806fc --- /dev/null +++ b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/maininfo/MainInfoController.java @@ -0,0 +1,104 @@ +package com.zteits.urbanops.module.workorder.controller.admin.maininfo; + +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import jakarta.validation.constraints.*; +import jakarta.validation.*; +import jakarta.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.zteits.urbanops.framework.common.pojo.PageParam; +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.common.pojo.CommonResult; +import com.zteits.urbanops.framework.common.util.object.BeanUtils; +import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; + +import com.zteits.urbanops.framework.excel.core.util.ExcelUtils; + +import com.zteits.urbanops.framework.apilog.core.annotation.ApiAccessLog; +import static com.zteits.urbanops.framework.apilog.core.enums.OperateTypeEnum.*; + +import com.zteits.urbanops.module.workorder.controller.admin.maininfo.vo.*; +import com.zteits.urbanops.module.workorder.dal.dataobject.maininfo.MainInfoDO; +import com.zteits.urbanops.module.workorder.service.maininfo.MainInfoService; + +@Tag(name = "管理后台 - 工单信息") +@RestController +@RequestMapping("/workorder/main-info") +@Validated +public class MainInfoController { + + @Resource + private MainInfoService mainInfoService; + + @PostMapping("/create") + @Operation(summary = "创建工单信息") + @PreAuthorize("@ss.hasPermission('workorder:main-info:create')") + public CommonResult createMainInfo(@Valid @RequestBody MainInfoSaveReqVO createReqVO) { + return success(mainInfoService.createMainInfo(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新工单信息") + @PreAuthorize("@ss.hasPermission('workorder:main-info:update')") + public CommonResult updateMainInfo(@Valid @RequestBody MainInfoSaveReqVO updateReqVO) { + mainInfoService.updateMainInfo(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除工单信息") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('workorder:main-info:delete')") + public CommonResult deleteMainInfo(@RequestParam("id") Long id) { + mainInfoService.deleteMainInfo(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除工单信息") + @PreAuthorize("@ss.hasPermission('workorder:main-info:delete')") + public CommonResult deleteMainInfoList(@RequestParam("ids") List ids) { + mainInfoService.deleteMainInfoListByIds(ids); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得工单信息") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('workorder:main-info:query')") + public CommonResult getMainInfo(@RequestParam("id") Long id) { + MainInfoDO mainInfo = mainInfoService.getMainInfo(id); + return success(BeanUtils.toBean(mainInfo, MainInfoRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得工单信息分页") + @PreAuthorize("@ss.hasPermission('workorder:main-info:query')") + public CommonResult> getMainInfoPage(@Valid MainInfoPageReqVO pageReqVO) { + PageResult pageResult = mainInfoService.getMainInfoPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, MainInfoRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出工单信息 Excel") + @PreAuthorize("@ss.hasPermission('workorder:main-info:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportMainInfoExcel(@Valid MainInfoPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = mainInfoService.getMainInfoPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "工单信息.xls", "数据", MainInfoRespVO.class, + BeanUtils.toBean(list, MainInfoRespVO.class)); + } + +} \ No newline at end of file diff --git a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/maininfo/vo/MainInfoPageReqVO.java b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/maininfo/vo/MainInfoPageReqVO.java new file mode 100644 index 0000000..83629e8 --- /dev/null +++ b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/maininfo/vo/MainInfoPageReqVO.java @@ -0,0 +1,100 @@ +package com.zteits.urbanops.module.workorder.controller.admin.maininfo.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zteits.urbanops.framework.common.pojo.PageParam; +import java.math.BigDecimal; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 工单信息分页 Request VO") +@Data +public class MainInfoPageReqVO extends PageParam { + + @Schema(description = "业务线:yl 园林,wy 物业,sz 市政 ") + private String busiLine; + + @Schema(description = "工单号") + private String orderNo; + + @Schema(description = "工单名称", example = "张三") + private String orderName; + + @Schema(description = "来源ID", example = "1828") + private Integer sourceId; + + @Schema(description = "来源名称", example = "芋艿") + private String sourceName; + + @Schema(description = "道路ID", example = "21128") + private Long roadId; + + @Schema(description = "道路名称", example = "王五") + private String roadName; + + @Schema(description = "街道ID", example = "27852") + private String streetId; + + @Schema(description = "街道名称", example = "芋艿") + private String streetName; + + @Schema(description = "养护级别ID", example = "28278") + private Integer curingLevelId; + + @Schema(description = "养护级别", example = "王五") + private String curingLevelName; + + @Schema(description = "提交日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] commitDate; + + @Schema(description = "紧急程度:1:特急;2:紧急;3:一般", example = "2") + private Integer pressingType; + + @Schema(description = "提交用户ID", example = "12757") + private Long userId; + + @Schema(description = "提交用户名称", example = "王五") + private String userName; + + @Schema(description = "部门id", example = "26936") + private Long companyId; + + @Schema(description = "经纬度类型: 1:国标; 2:百度;3:高德;4:腾讯", example = "2") + private Integer latLonType; + + @Schema(description = "经度") + private BigDecimal lat; + + @Schema(description = "维度") + private BigDecimal lon; + + @Schema(description = "经纬度地址") + private String lonLatAddress; + + @Schema(description = "三方工单ID") + private String thirdWorkNo; + + @Schema(description = "三方工单结果上报状态:1:待推送;2:推送成功;3:推送失败") + private Integer thirdPushState; + + @Schema(description = "业务状态", example = "1") + private String buzStatus; + + @Schema(description = "审批状态", example = "2") + private Integer status; + + @Schema(description = "流程实例的编号", example = "9184") + private String processInstanceId; + + @Schema(description = "工单描述", example = "你说的对") + private String remark; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/maininfo/vo/MainInfoRespVO.java b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/maininfo/vo/MainInfoRespVO.java new file mode 100644 index 0000000..f8d705c --- /dev/null +++ b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/maininfo/vo/MainInfoRespVO.java @@ -0,0 +1,128 @@ +package com.zteits.urbanops.module.workorder.controller.admin.maininfo.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import java.math.BigDecimal; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import cn.idev.excel.annotation.*; + +@Schema(description = "管理后台 - 工单信息 Response VO") +@Data +@ExcelIgnoreUnannotated +public class MainInfoRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7114") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "业务线:yl 园林,wy 物业,sz 市政 ", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("业务线:yl 园林,wy 物业,sz 市政 ") + private String busiLine; + + @Schema(description = "工单号", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("工单号") + private String orderNo; + + @Schema(description = "工单名称", example = "张三") + @ExcelProperty("工单名称") + private String orderName; + + @Schema(description = "来源ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1828") + @ExcelProperty("来源ID") + private Integer sourceId; + + @Schema(description = "来源名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") + @ExcelProperty("来源名称") + private String sourceName; + + @Schema(description = "道路ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21128") + @ExcelProperty("道路ID") + private Long roadId; + + @Schema(description = "道路名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") + @ExcelProperty("道路名称") + private String roadName; + + @Schema(description = "街道ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "27852") + @ExcelProperty("街道ID") + private String streetId; + + @Schema(description = "街道名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") + @ExcelProperty("街道名称") + private String streetName; + + @Schema(description = "养护级别ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "28278") + @ExcelProperty("养护级别ID") + private Integer curingLevelId; + + @Schema(description = "养护级别", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") + @ExcelProperty("养护级别") + private String curingLevelName; + + @Schema(description = "提交日期", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("提交日期") + private LocalDateTime commitDate; + + @Schema(description = "紧急程度:1:特急;2:紧急;3:一般", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @ExcelProperty("紧急程度:1:特急;2:紧急;3:一般") + private Integer pressingType; + + @Schema(description = "提交用户ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12757") + @ExcelProperty("提交用户ID") + private Long userId; + + @Schema(description = "提交用户名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") + @ExcelProperty("提交用户名称") + private String userName; + + @Schema(description = "部门id", requiredMode = Schema.RequiredMode.REQUIRED, example = "26936") + @ExcelProperty("部门id") + private Long companyId; + + @Schema(description = "经纬度类型: 1:国标; 2:百度;3:高德;4:腾讯", example = "2") + @ExcelProperty("经纬度类型: 1:国标; 2:百度;3:高德;4:腾讯") + private Integer latLonType; + + @Schema(description = "经度", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("经度") + private BigDecimal lat; + + @Schema(description = "维度", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("维度") + private BigDecimal lon; + + @Schema(description = "经纬度地址", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("经纬度地址") + private String lonLatAddress; + + @Schema(description = "三方工单ID") + @ExcelProperty("三方工单ID") + private String thirdWorkNo; + + @Schema(description = "三方工单结果上报状态:1:待推送;2:推送成功;3:推送失败") + @ExcelProperty("三方工单结果上报状态:1:待推送;2:推送成功;3:推送失败") + private Integer thirdPushState; + + @Schema(description = "业务状态", example = "1") + @ExcelProperty("业务状态") + private String buzStatus; + + @Schema(description = "审批状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @ExcelProperty("审批状态") + private Integer status; + + @Schema(description = "流程实例的编号", example = "9184") + @ExcelProperty("流程实例的编号") + private String processInstanceId; + + @Schema(description = "工单描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "你说的对") + @ExcelProperty("工单描述") + private String remark; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/maininfo/vo/MainInfoSaveReqVO.java b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/maininfo/vo/MainInfoSaveReqVO.java new file mode 100644 index 0000000..9a3e5e4 --- /dev/null +++ b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/maininfo/vo/MainInfoSaveReqVO.java @@ -0,0 +1,116 @@ +package com.zteits.urbanops.module.workorder.controller.admin.maininfo.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; +import java.math.BigDecimal; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 工单信息新增/修改 Request VO") +@Data +public class MainInfoSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7114") + private Long id; + + @Schema(description = "业务线:yl 园林,wy 物业,sz 市政 ", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "业务线:yl 园林,wy 物业,sz 市政 不能为空") + private String busiLine; + + @Schema(description = "工单号", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "工单号不能为空") + private String orderNo; + + @Schema(description = "工单名称", example = "张三") + private String orderName; + + @Schema(description = "来源ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1828") + @NotNull(message = "来源ID不能为空") + private Integer sourceId; + + @Schema(description = "来源名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") + @NotEmpty(message = "来源名称不能为空") + private String sourceName; + + @Schema(description = "道路ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21128") + @NotNull(message = "道路ID不能为空") + private Long roadId; + + @Schema(description = "道路名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") + @NotEmpty(message = "道路名称不能为空") + private String roadName; + + @Schema(description = "街道ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "27852") + @NotEmpty(message = "街道ID不能为空") + private String streetId; + + @Schema(description = "街道名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") + @NotEmpty(message = "街道名称不能为空") + private String streetName; + + @Schema(description = "养护级别ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "28278") + @NotNull(message = "养护级别ID不能为空") + private Integer curingLevelId; + + @Schema(description = "养护级别", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") + @NotEmpty(message = "养护级别不能为空") + private String curingLevelName; + + @Schema(description = "提交日期", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "提交日期不能为空") + private LocalDateTime commitDate; + + @Schema(description = "紧急程度:1:特急;2:紧急;3:一般", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @NotNull(message = "紧急程度:1:特急;2:紧急;3:一般不能为空") + private Integer pressingType; + + @Schema(description = "提交用户ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12757") + @NotNull(message = "提交用户ID不能为空") + private Long userId; + + @Schema(description = "提交用户名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") + @NotEmpty(message = "提交用户名称不能为空") + private String userName; + + @Schema(description = "部门id", requiredMode = Schema.RequiredMode.REQUIRED, example = "26936") + @NotNull(message = "部门id不能为空") + private Long companyId; + + @Schema(description = "经纬度类型: 1:国标; 2:百度;3:高德;4:腾讯", example = "2") + private Integer latLonType; + + @Schema(description = "经度", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "经度不能为空") + private BigDecimal lat; + + @Schema(description = "维度", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "维度不能为空") + private BigDecimal lon; + + @Schema(description = "经纬度地址", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "经纬度地址不能为空") + private String lonLatAddress; + + @Schema(description = "三方工单ID") + private String thirdWorkNo; + + @Schema(description = "三方工单结果上报状态:1:待推送;2:推送成功;3:推送失败") + private Integer thirdPushState; + + @Schema(description = "业务状态", example = "1") + private String buzStatus; + + @Schema(description = "审批状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @NotNull(message = "审批状态不能为空") + private Integer status; + + @Schema(description = "流程实例的编号", example = "9184") + private String processInstanceId; + + @Schema(description = "工单描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "你说的对") + @NotEmpty(message = "工单描述不能为空") + private String remark; + +} \ No newline at end of file diff --git a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/materialdetail/MaterialDetailController.java b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/materialdetail/MaterialDetailController.java new file mode 100644 index 0000000..4b2d08b --- /dev/null +++ b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/materialdetail/MaterialDetailController.java @@ -0,0 +1,104 @@ +package com.zteits.urbanops.module.workorder.controller.admin.materialdetail; + +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import jakarta.validation.constraints.*; +import jakarta.validation.*; +import jakarta.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.zteits.urbanops.framework.common.pojo.PageParam; +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.common.pojo.CommonResult; +import com.zteits.urbanops.framework.common.util.object.BeanUtils; +import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; + +import com.zteits.urbanops.framework.excel.core.util.ExcelUtils; + +import com.zteits.urbanops.framework.apilog.core.annotation.ApiAccessLog; +import static com.zteits.urbanops.framework.apilog.core.enums.OperateTypeEnum.*; + +import com.zteits.urbanops.module.workorder.controller.admin.materialdetail.vo.*; +import com.zteits.urbanops.module.workorder.dal.dataobject.materialdetail.MaterialDetailDO; +import com.zteits.urbanops.module.workorder.service.materialdetail.MaterialDetailService; + +@Tag(name = "管理后台 - 工单耗材明细") +@RestController +@RequestMapping("/workorder/material-detail") +@Validated +public class MaterialDetailController { + + @Resource + private MaterialDetailService materialDetailService; + + @PostMapping("/create") + @Operation(summary = "创建工单耗材明细") + @PreAuthorize("@ss.hasPermission('workorder:material-detail:create')") + public CommonResult createMaterialDetail(@Valid @RequestBody MaterialDetailSaveReqVO createReqVO) { + return success(materialDetailService.createMaterialDetail(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新工单耗材明细") + @PreAuthorize("@ss.hasPermission('workorder:material-detail:update')") + public CommonResult updateMaterialDetail(@Valid @RequestBody MaterialDetailSaveReqVO updateReqVO) { + materialDetailService.updateMaterialDetail(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除工单耗材明细") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('workorder:material-detail:delete')") + public CommonResult deleteMaterialDetail(@RequestParam("id") Long id) { + materialDetailService.deleteMaterialDetail(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除工单耗材明细") + @PreAuthorize("@ss.hasPermission('workorder:material-detail:delete')") + public CommonResult deleteMaterialDetailList(@RequestParam("ids") List ids) { + materialDetailService.deleteMaterialDetailListByIds(ids); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得工单耗材明细") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('workorder:material-detail:query')") + public CommonResult getMaterialDetail(@RequestParam("id") Long id) { + MaterialDetailDO materialDetail = materialDetailService.getMaterialDetail(id); + return success(BeanUtils.toBean(materialDetail, MaterialDetailRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得工单耗材明细分页") + @PreAuthorize("@ss.hasPermission('workorder:material-detail:query')") + public CommonResult> getMaterialDetailPage(@Valid MaterialDetailPageReqVO pageReqVO) { + PageResult pageResult = materialDetailService.getMaterialDetailPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, MaterialDetailRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出工单耗材明细 Excel") + @PreAuthorize("@ss.hasPermission('workorder:material-detail:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportMaterialDetailExcel(@Valid MaterialDetailPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = materialDetailService.getMaterialDetailPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "工单耗材明细.xls", "数据", MaterialDetailRespVO.class, + BeanUtils.toBean(list, MaterialDetailRespVO.class)); + } + +} \ No newline at end of file diff --git a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/materialdetail/vo/MaterialDetailPageReqVO.java b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/materialdetail/vo/MaterialDetailPageReqVO.java new file mode 100644 index 0000000..faaa226 --- /dev/null +++ b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/materialdetail/vo/MaterialDetailPageReqVO.java @@ -0,0 +1,59 @@ +package com.zteits.urbanops.module.workorder.controller.admin.materialdetail.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zteits.urbanops.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 工单耗材明细分页 Request VO") +@Data +public class MaterialDetailPageReqVO extends PageParam { + + @Schema(description = "工单号") + private String orderNo; + + @Schema(description = "提交用户ID", example = "10300") + private Long userId; + + @Schema(description = "提交用户名称", example = "赵六") + private String userName; + + @Schema(description = "种类ID", example = "27821") + private Long classifyId; + + @Schema(description = "种类名称", example = "张三") + private String classifyName; + + @Schema(description = "类别ID", example = "23969") + private Long typeId; + + @Schema(description = "类别名称", example = "李四") + private String typeName; + + @Schema(description = "类别明细ID", example = "11240") + private Long typeDetailId; + + @Schema(description = "类别明细名称", example = "赵六") + private String typeDetailName; + + @Schema(description = "使用数量", example = "20141") + private Double userCount; + + @Schema(description = "单位", example = "李四") + private String unitName; + + @Schema(description = "状态(0正常 1停用)", example = "1") + private String status; + + @Schema(description = "描述", example = "你说的对") + private String remark; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/materialdetail/vo/MaterialDetailRespVO.java b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/materialdetail/vo/MaterialDetailRespVO.java new file mode 100644 index 0000000..89f8a59 --- /dev/null +++ b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/materialdetail/vo/MaterialDetailRespVO.java @@ -0,0 +1,75 @@ +package com.zteits.urbanops.module.workorder.controller.admin.materialdetail.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import cn.idev.excel.annotation.*; + +@Schema(description = "管理后台 - 工单耗材明细 Response VO") +@Data +@ExcelIgnoreUnannotated +public class MaterialDetailRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "234") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "工单号", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("工单号") + private String orderNo; + + @Schema(description = "提交用户ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "10300") + @ExcelProperty("提交用户ID") + private Long userId; + + @Schema(description = "提交用户名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") + @ExcelProperty("提交用户名称") + private String userName; + + @Schema(description = "种类ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "27821") + @ExcelProperty("种类ID") + private Long classifyId; + + @Schema(description = "种类名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") + @ExcelProperty("种类名称") + private String classifyName; + + @Schema(description = "类别ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23969") + @ExcelProperty("类别ID") + private Long typeId; + + @Schema(description = "类别名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") + @ExcelProperty("类别名称") + private String typeName; + + @Schema(description = "类别明细ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11240") + @ExcelProperty("类别明细ID") + private Long typeDetailId; + + @Schema(description = "类别明细名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") + @ExcelProperty("类别明细名称") + private String typeDetailName; + + @Schema(description = "使用数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "20141") + @ExcelProperty("使用数量") + private Double userCount; + + @Schema(description = "单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") + @ExcelProperty("单位") + private String unitName; + + @Schema(description = "状态(0正常 1停用)", example = "1") + @ExcelProperty("状态(0正常 1停用)") + private String status; + + @Schema(description = "描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "你说的对") + @ExcelProperty("描述") + private String remark; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/materialdetail/vo/MaterialDetailSaveReqVO.java b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/materialdetail/vo/MaterialDetailSaveReqVO.java new file mode 100644 index 0000000..fd21287 --- /dev/null +++ b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/materialdetail/vo/MaterialDetailSaveReqVO.java @@ -0,0 +1,66 @@ +package com.zteits.urbanops.module.workorder.controller.admin.materialdetail.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; + +@Schema(description = "管理后台 - 工单耗材明细新增/修改 Request VO") +@Data +public class MaterialDetailSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "234") + private Long id; + + @Schema(description = "工单号", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "工单号不能为空") + private String orderNo; + + @Schema(description = "提交用户ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "10300") + @NotNull(message = "提交用户ID不能为空") + private Long userId; + + @Schema(description = "提交用户名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") + @NotEmpty(message = "提交用户名称不能为空") + private String userName; + + @Schema(description = "种类ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "27821") + @NotNull(message = "种类ID不能为空") + private Long classifyId; + + @Schema(description = "种类名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") + @NotEmpty(message = "种类名称不能为空") + private String classifyName; + + @Schema(description = "类别ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23969") + @NotNull(message = "类别ID不能为空") + private Long typeId; + + @Schema(description = "类别名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") + @NotEmpty(message = "类别名称不能为空") + private String typeName; + + @Schema(description = "类别明细ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11240") + @NotNull(message = "类别明细ID不能为空") + private Long typeDetailId; + + @Schema(description = "类别明细名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") + @NotEmpty(message = "类别明细名称不能为空") + private String typeDetailName; + + @Schema(description = "使用数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "20141") + @NotNull(message = "使用数量不能为空") + private Double userCount; + + @Schema(description = "单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") + @NotEmpty(message = "单位不能为空") + private String unitName; + + @Schema(description = "状态(0正常 1停用)", example = "1") + private String status; + + @Schema(description = "描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "你说的对") + @NotEmpty(message = "描述不能为空") + private String remark; + +} \ No newline at end of file diff --git a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/dataobject/attachment/AttachmentDO.java b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/dataobject/attachment/AttachmentDO.java new file mode 100644 index 0000000..68bd6a0 --- /dev/null +++ b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/dataobject/attachment/AttachmentDO.java @@ -0,0 +1,64 @@ +package com.zteits.urbanops.module.workorder.dal.dataobject.attachment; + +import lombok.*; +import java.util.*; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO; + +/** + * 工单附件信息 DO + * + * @author 超级管理员 + */ +@TableName("workorder_attachment") +@KeySequence("workorder_attachment_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class AttachmentDO extends BaseDO { + + /** + * ID + */ + @TableId + private Long id; + /** + * 工单号 + */ + private String orderNo; + /** + * 业务线:yl 园林,wy 物业,sz 市政 + */ + private String busiLine; + /** + * 业务类型:01 问题图片,02 街道图片,03 选景图片 + */ + private String busiType; + /** + * 文件名称 + */ + private String fileNames; + /** + * 路径 + */ + private String hostUrl; + /** + * 文件大小 + */ + private String fileSize; + /** + * 文件类型 + */ + private String contentType; + /** + * 描述 + */ + private String remark; + + +} \ No newline at end of file diff --git a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/dataobject/maininfo/MainInfoDO.java b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/dataobject/maininfo/MainInfoDO.java new file mode 100644 index 0000000..d320ae3 --- /dev/null +++ b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/dataobject/maininfo/MainInfoDO.java @@ -0,0 +1,139 @@ +package com.zteits.urbanops.module.workorder.dal.dataobject.maininfo; + +import lombok.*; +import java.util.*; +import java.time.LocalDateTime; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO; + +/** + * 工单信息 DO + * + * @author 超级管理员 + */ +@TableName("workorder_main_info") +@KeySequence("workorder_main_info_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class MainInfoDO extends BaseDO { + + /** + * ID + */ + @TableId + private Long id; + /** + * 业务线:yl 园林,wy 物业,sz 市政 + */ + private String busiLine; + /** + * 工单号 + */ + private String orderNo; + /** + * 工单名称 + */ + private String orderName; + /** + * 来源ID + */ + private Integer sourceId; + /** + * 来源名称 + */ + private String sourceName; + /** + * 道路ID + */ + private Long roadId; + /** + * 道路名称 + */ + private String roadName; + /** + * 街道ID + */ + private String streetId; + /** + * 街道名称 + */ + private String streetName; + /** + * 养护级别ID + */ + private Integer curingLevelId; + /** + * 养护级别 + */ + private String curingLevelName; + /** + * 提交日期 + */ + private LocalDateTime commitDate; + /** + * 紧急程度:1:特急;2:紧急;3:一般 + */ + private Integer pressingType; + /** + * 提交用户ID + */ + private Long userId; + /** + * 提交用户名称 + */ + private String userName; + /** + * 部门id + */ + private Long companyId; + /** + * 经纬度类型: 1:国标; 2:百度;3:高德;4:腾讯 + */ + private Integer latLonType; + /** + * 经度 + */ + private BigDecimal lat; + /** + * 维度 + */ + private BigDecimal lon; + /** + * 经纬度地址 + */ + private String lonLatAddress; + /** + * 三方工单ID + */ + private String thirdWorkNo; + /** + * 三方工单结果上报状态:1:待推送;2:推送成功;3:推送失败 + */ + private Integer thirdPushState; + /** + * 业务状态 + */ + private String buzStatus; + /** + * 审批状态 + */ + private Integer status; + /** + * 流程实例的编号 + */ + private String processInstanceId; + /** + * 工单描述 + */ + private String remark; + + +} \ No newline at end of file diff --git a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/dataobject/materialdetail/MaterialDetailDO.java b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/dataobject/materialdetail/MaterialDetailDO.java new file mode 100644 index 0000000..215fd64 --- /dev/null +++ b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/dataobject/materialdetail/MaterialDetailDO.java @@ -0,0 +1,84 @@ +package com.zteits.urbanops.module.workorder.dal.dataobject.materialdetail; + +import lombok.*; +import java.util.*; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO; + +/** + * 工单耗材明细 DO + * + * @author 超级管理员 + */ +@TableName("workorder_material_detail") +@KeySequence("workorder_material_detail_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class MaterialDetailDO extends BaseDO { + + /** + * ID + */ + @TableId + private Long id; + /** + * 工单号 + */ + private String orderNo; + /** + * 提交用户ID + */ + private Long userId; + /** + * 提交用户名称 + */ + private String userName; + /** + * 种类ID + */ + private Long classifyId; + /** + * 种类名称 + */ + private String classifyName; + /** + * 类别ID + */ + private Long typeId; + /** + * 类别名称 + */ + private String typeName; + /** + * 类别明细ID + */ + private Long typeDetailId; + /** + * 类别明细名称 + */ + private String typeDetailName; + /** + * 使用数量 + */ + private Double userCount; + /** + * 单位 + */ + private String unitName; + /** + * 状态(0正常 1停用) + */ + private String status; + /** + * 描述 + */ + private String remark; + + +} \ No newline at end of file diff --git a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/mysql/attachment/AttachmentMapper.java b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/mysql/attachment/AttachmentMapper.java new file mode 100644 index 0000000..01ebd98 --- /dev/null +++ b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/mysql/attachment/AttachmentMapper.java @@ -0,0 +1,34 @@ +package com.zteits.urbanops.module.workorder.dal.mysql.attachment; + +import java.util.*; + +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; +import com.zteits.urbanops.module.workorder.dal.dataobject.attachment.AttachmentDO; +import org.apache.ibatis.annotations.Mapper; +import com.zteits.urbanops.module.workorder.controller.admin.attachment.vo.*; + +/** + * 工单附件信息 Mapper + * + * @author 超级管理员 + */ +@Mapper +public interface AttachmentMapper extends BaseMapperX { + + default PageResult selectPage(AttachmentPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(AttachmentDO::getOrderNo, reqVO.getOrderNo()) + .eqIfPresent(AttachmentDO::getBusiLine, reqVO.getBusiLine()) + .eqIfPresent(AttachmentDO::getBusiType, reqVO.getBusiType()) + .eqIfPresent(AttachmentDO::getFileNames, reqVO.getFileNames()) + .eqIfPresent(AttachmentDO::getHostUrl, reqVO.getHostUrl()) + .eqIfPresent(AttachmentDO::getFileSize, reqVO.getFileSize()) + .eqIfPresent(AttachmentDO::getContentType, reqVO.getContentType()) + .eqIfPresent(AttachmentDO::getRemark, reqVO.getRemark()) + .betweenIfPresent(AttachmentDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(AttachmentDO::getId)); + } + +} \ No newline at end of file diff --git a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/mysql/maininfo/MainInfoMapper.java b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/mysql/maininfo/MainInfoMapper.java new file mode 100644 index 0000000..70d1a17 --- /dev/null +++ b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/mysql/maininfo/MainInfoMapper.java @@ -0,0 +1,52 @@ +package com.zteits.urbanops.module.workorder.dal.mysql.maininfo; + +import java.util.*; + +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; +import com.zteits.urbanops.module.workorder.dal.dataobject.maininfo.MainInfoDO; +import org.apache.ibatis.annotations.Mapper; +import com.zteits.urbanops.module.workorder.controller.admin.maininfo.vo.*; + +/** + * 工单信息 Mapper + * + * @author 超级管理员 + */ +@Mapper +public interface MainInfoMapper extends BaseMapperX { + + default PageResult selectPage(MainInfoPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(MainInfoDO::getBusiLine, reqVO.getBusiLine()) + .eqIfPresent(MainInfoDO::getOrderNo, reqVO.getOrderNo()) + .likeIfPresent(MainInfoDO::getOrderName, reqVO.getOrderName()) + .eqIfPresent(MainInfoDO::getSourceId, reqVO.getSourceId()) + .likeIfPresent(MainInfoDO::getSourceName, reqVO.getSourceName()) + .eqIfPresent(MainInfoDO::getRoadId, reqVO.getRoadId()) + .likeIfPresent(MainInfoDO::getRoadName, reqVO.getRoadName()) + .eqIfPresent(MainInfoDO::getStreetId, reqVO.getStreetId()) + .likeIfPresent(MainInfoDO::getStreetName, reqVO.getStreetName()) + .eqIfPresent(MainInfoDO::getCuringLevelId, reqVO.getCuringLevelId()) + .likeIfPresent(MainInfoDO::getCuringLevelName, reqVO.getCuringLevelName()) + .betweenIfPresent(MainInfoDO::getCommitDate, reqVO.getCommitDate()) + .eqIfPresent(MainInfoDO::getPressingType, reqVO.getPressingType()) + .eqIfPresent(MainInfoDO::getUserId, reqVO.getUserId()) + .likeIfPresent(MainInfoDO::getUserName, reqVO.getUserName()) + .eqIfPresent(MainInfoDO::getCompanyId, reqVO.getCompanyId()) + .eqIfPresent(MainInfoDO::getLatLonType, reqVO.getLatLonType()) + .eqIfPresent(MainInfoDO::getLat, reqVO.getLat()) + .eqIfPresent(MainInfoDO::getLon, reqVO.getLon()) + .eqIfPresent(MainInfoDO::getLonLatAddress, reqVO.getLonLatAddress()) + .eqIfPresent(MainInfoDO::getThirdWorkNo, reqVO.getThirdWorkNo()) + .eqIfPresent(MainInfoDO::getThirdPushState, reqVO.getThirdPushState()) + .eqIfPresent(MainInfoDO::getBuzStatus, reqVO.getBuzStatus()) + .eqIfPresent(MainInfoDO::getStatus, reqVO.getStatus()) + .eqIfPresent(MainInfoDO::getProcessInstanceId, reqVO.getProcessInstanceId()) + .eqIfPresent(MainInfoDO::getRemark, reqVO.getRemark()) + .betweenIfPresent(MainInfoDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(MainInfoDO::getId)); + } + +} \ No newline at end of file diff --git a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/mysql/materialdetail/MaterialDetailMapper.java b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/mysql/materialdetail/MaterialDetailMapper.java new file mode 100644 index 0000000..a85fbbb --- /dev/null +++ b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/mysql/materialdetail/MaterialDetailMapper.java @@ -0,0 +1,39 @@ +package com.zteits.urbanops.module.workorder.dal.mysql.materialdetail; + +import java.util.*; + +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; +import com.zteits.urbanops.module.workorder.dal.dataobject.materialdetail.MaterialDetailDO; +import org.apache.ibatis.annotations.Mapper; +import com.zteits.urbanops.module.workorder.controller.admin.materialdetail.vo.*; + +/** + * 工单耗材明细 Mapper + * + * @author 超级管理员 + */ +@Mapper +public interface MaterialDetailMapper extends BaseMapperX { + + default PageResult selectPage(MaterialDetailPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(MaterialDetailDO::getOrderNo, reqVO.getOrderNo()) + .eqIfPresent(MaterialDetailDO::getUserId, reqVO.getUserId()) + .likeIfPresent(MaterialDetailDO::getUserName, reqVO.getUserName()) + .eqIfPresent(MaterialDetailDO::getClassifyId, reqVO.getClassifyId()) + .likeIfPresent(MaterialDetailDO::getClassifyName, reqVO.getClassifyName()) + .eqIfPresent(MaterialDetailDO::getTypeId, reqVO.getTypeId()) + .likeIfPresent(MaterialDetailDO::getTypeName, reqVO.getTypeName()) + .eqIfPresent(MaterialDetailDO::getTypeDetailId, reqVO.getTypeDetailId()) + .likeIfPresent(MaterialDetailDO::getTypeDetailName, reqVO.getTypeDetailName()) + .eqIfPresent(MaterialDetailDO::getUserCount, reqVO.getUserCount()) + .likeIfPresent(MaterialDetailDO::getUnitName, reqVO.getUnitName()) + .eqIfPresent(MaterialDetailDO::getStatus, reqVO.getStatus()) + .eqIfPresent(MaterialDetailDO::getRemark, reqVO.getRemark()) + .betweenIfPresent(MaterialDetailDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(MaterialDetailDO::getId)); + } + +} \ No newline at end of file diff --git a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/enums/ErrorCodeConstants.java b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/enums/ErrorCodeConstants.java new file mode 100644 index 0000000..9ebffe2 --- /dev/null +++ b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/enums/ErrorCodeConstants.java @@ -0,0 +1,19 @@ +package com.zteits.urbanops.module.workorder.enums; + + +import com.zteits.urbanops.framework.common.exception.ErrorCode; + +/** + * workorder 错误码枚举类 + *

+ * workorder 系统,使用 1-100-000-000 段 + */ +public interface ErrorCodeConstants { + + // ========== server 工单 1-100-001-000 ========== + ErrorCode MAIN_INFO_NOT_EXISTS = new ErrorCode(1-100-001-000, "工单信息不存在"); + + ErrorCode ATTACHMENT_NOT_EXISTS = new ErrorCode(1-100-002-000, "工单附件信息不存在"); + + ErrorCode MATERIAL_DETAIL_NOT_EXISTS = new ErrorCode(1-100-003-000, "工单耗材明细不存在"); +} diff --git a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/attachment/AttachmentService.java b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/attachment/AttachmentService.java new file mode 100644 index 0000000..bf01a32 --- /dev/null +++ b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/attachment/AttachmentService.java @@ -0,0 +1,62 @@ +package com.zteits.urbanops.module.workorder.service.attachment; + +import java.util.*; +import jakarta.validation.*; +import com.zteits.urbanops.module.workorder.controller.admin.attachment.vo.*; +import com.zteits.urbanops.module.workorder.dal.dataobject.attachment.AttachmentDO; +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.common.pojo.PageParam; + +/** + * 工单附件信息 Service 接口 + * + * @author 超级管理员 + */ +public interface AttachmentService { + + /** + * 创建工单附件信息 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createAttachment(@Valid AttachmentSaveReqVO createReqVO); + + /** + * 更新工单附件信息 + * + * @param updateReqVO 更新信息 + */ + void updateAttachment(@Valid AttachmentSaveReqVO updateReqVO); + + /** + * 删除工单附件信息 + * + * @param id 编号 + */ + void deleteAttachment(Long id); + + /** + * 批量删除工单附件信息 + * + * @param ids 编号 + */ + void deleteAttachmentListByIds(List ids); + + /** + * 获得工单附件信息 + * + * @param id 编号 + * @return 工单附件信息 + */ + AttachmentDO getAttachment(Long id); + + /** + * 获得工单附件信息分页 + * + * @param pageReqVO 分页查询 + * @return 工单附件信息分页 + */ + PageResult getAttachmentPage(AttachmentPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/attachment/AttachmentServiceImpl.java b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/attachment/AttachmentServiceImpl.java new file mode 100644 index 0000000..0af1491 --- /dev/null +++ b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/attachment/AttachmentServiceImpl.java @@ -0,0 +1,85 @@ +package com.zteits.urbanops.module.workorder.service.attachment; + +import cn.hutool.core.collection.CollUtil; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import com.zteits.urbanops.module.workorder.controller.admin.attachment.vo.*; +import com.zteits.urbanops.module.workorder.dal.dataobject.attachment.AttachmentDO; +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.common.pojo.PageParam; +import com.zteits.urbanops.framework.common.util.object.BeanUtils; + +import com.zteits.urbanops.module.workorder.dal.mysql.attachment.AttachmentMapper; + +import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.convertList; +import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.diffList; +import static com.zteits.urbanops.module.workorder.enums.ErrorCodeConstants.*; + +/** + * 工单附件信息 Service 实现类 + * + * @author 超级管理员 + */ +@Service +@Validated +public class AttachmentServiceImpl implements AttachmentService { + + @Resource + private AttachmentMapper attachmentMapper; + + @Override + public Long createAttachment(AttachmentSaveReqVO createReqVO) { + // 插入 + AttachmentDO attachment = BeanUtils.toBean(createReqVO, AttachmentDO.class); + attachmentMapper.insert(attachment); + + // 返回 + return attachment.getId(); + } + + @Override + public void updateAttachment(AttachmentSaveReqVO updateReqVO) { + // 校验存在 + validateAttachmentExists(updateReqVO.getId()); + // 更新 + AttachmentDO updateObj = BeanUtils.toBean(updateReqVO, AttachmentDO.class); + attachmentMapper.updateById(updateObj); + } + + @Override + public void deleteAttachment(Long id) { + // 校验存在 + validateAttachmentExists(id); + // 删除 + attachmentMapper.deleteById(id); + } + + @Override + public void deleteAttachmentListByIds(List ids) { + // 删除 + attachmentMapper.deleteByIds(ids); + } + + + private void validateAttachmentExists(Long id) { + if (attachmentMapper.selectById(id) == null) { + throw exception(ATTACHMENT_NOT_EXISTS); + } + } + + @Override + public AttachmentDO getAttachment(Long id) { + return attachmentMapper.selectById(id); + } + + @Override + public PageResult getAttachmentPage(AttachmentPageReqVO pageReqVO) { + return attachmentMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/maininfo/MainInfoService.java b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/maininfo/MainInfoService.java new file mode 100644 index 0000000..95cee14 --- /dev/null +++ b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/maininfo/MainInfoService.java @@ -0,0 +1,62 @@ +package com.zteits.urbanops.module.workorder.service.maininfo; + +import java.util.*; +import jakarta.validation.*; +import com.zteits.urbanops.module.workorder.controller.admin.maininfo.vo.*; +import com.zteits.urbanops.module.workorder.dal.dataobject.maininfo.MainInfoDO; +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.common.pojo.PageParam; + +/** + * 工单信息 Service 接口 + * + * @author 超级管理员 + */ +public interface MainInfoService { + + /** + * 创建工单信息 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createMainInfo(@Valid MainInfoSaveReqVO createReqVO); + + /** + * 更新工单信息 + * + * @param updateReqVO 更新信息 + */ + void updateMainInfo(@Valid MainInfoSaveReqVO updateReqVO); + + /** + * 删除工单信息 + * + * @param id 编号 + */ + void deleteMainInfo(Long id); + + /** + * 批量删除工单信息 + * + * @param ids 编号 + */ + void deleteMainInfoListByIds(List ids); + + /** + * 获得工单信息 + * + * @param id 编号 + * @return 工单信息 + */ + MainInfoDO getMainInfo(Long id); + + /** + * 获得工单信息分页 + * + * @param pageReqVO 分页查询 + * @return 工单信息分页 + */ + PageResult getMainInfoPage(MainInfoPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/maininfo/MainInfoServiceImpl.java b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/maininfo/MainInfoServiceImpl.java new file mode 100644 index 0000000..3b11d64 --- /dev/null +++ b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/maininfo/MainInfoServiceImpl.java @@ -0,0 +1,85 @@ +package com.zteits.urbanops.module.workorder.service.maininfo; + +import cn.hutool.core.collection.CollUtil; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import com.zteits.urbanops.module.workorder.controller.admin.maininfo.vo.*; +import com.zteits.urbanops.module.workorder.dal.dataobject.maininfo.MainInfoDO; +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.common.pojo.PageParam; +import com.zteits.urbanops.framework.common.util.object.BeanUtils; + +import com.zteits.urbanops.module.workorder.dal.mysql.maininfo.MainInfoMapper; + +import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.convertList; +import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.diffList; +import static com.zteits.urbanops.module.workorder.enums.ErrorCodeConstants.*; + +/** + * 工单信息 Service 实现类 + * + * @author 超级管理员 + */ +@Service +@Validated +public class MainInfoServiceImpl implements MainInfoService { + + @Resource + private MainInfoMapper mainInfoMapper; + + @Override + public Long createMainInfo(MainInfoSaveReqVO createReqVO) { + // 插入 + MainInfoDO mainInfo = BeanUtils.toBean(createReqVO, MainInfoDO.class); + mainInfoMapper.insert(mainInfo); + + // 返回 + return mainInfo.getId(); + } + + @Override + public void updateMainInfo(MainInfoSaveReqVO updateReqVO) { + // 校验存在 + validateMainInfoExists(updateReqVO.getId()); + // 更新 + MainInfoDO updateObj = BeanUtils.toBean(updateReqVO, MainInfoDO.class); + mainInfoMapper.updateById(updateObj); + } + + @Override + public void deleteMainInfo(Long id) { + // 校验存在 + validateMainInfoExists(id); + // 删除 + mainInfoMapper.deleteById(id); + } + + @Override + public void deleteMainInfoListByIds(List ids) { + // 删除 + mainInfoMapper.deleteByIds(ids); + } + + + private void validateMainInfoExists(Long id) { + if (mainInfoMapper.selectById(id) == null) { + throw exception(MAIN_INFO_NOT_EXISTS); + } + } + + @Override + public MainInfoDO getMainInfo(Long id) { + return mainInfoMapper.selectById(id); + } + + @Override + public PageResult getMainInfoPage(MainInfoPageReqVO pageReqVO) { + return mainInfoMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/materialdetail/MaterialDetailService.java b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/materialdetail/MaterialDetailService.java new file mode 100644 index 0000000..812fe24 --- /dev/null +++ b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/materialdetail/MaterialDetailService.java @@ -0,0 +1,62 @@ +package com.zteits.urbanops.module.workorder.service.materialdetail; + +import java.util.*; +import jakarta.validation.*; +import com.zteits.urbanops.module.workorder.controller.admin.materialdetail.vo.*; +import com.zteits.urbanops.module.workorder.dal.dataobject.materialdetail.MaterialDetailDO; +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.common.pojo.PageParam; + +/** + * 工单耗材明细 Service 接口 + * + * @author 超级管理员 + */ +public interface MaterialDetailService { + + /** + * 创建工单耗材明细 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createMaterialDetail(@Valid MaterialDetailSaveReqVO createReqVO); + + /** + * 更新工单耗材明细 + * + * @param updateReqVO 更新信息 + */ + void updateMaterialDetail(@Valid MaterialDetailSaveReqVO updateReqVO); + + /** + * 删除工单耗材明细 + * + * @param id 编号 + */ + void deleteMaterialDetail(Long id); + + /** + * 批量删除工单耗材明细 + * + * @param ids 编号 + */ + void deleteMaterialDetailListByIds(List ids); + + /** + * 获得工单耗材明细 + * + * @param id 编号 + * @return 工单耗材明细 + */ + MaterialDetailDO getMaterialDetail(Long id); + + /** + * 获得工单耗材明细分页 + * + * @param pageReqVO 分页查询 + * @return 工单耗材明细分页 + */ + PageResult getMaterialDetailPage(MaterialDetailPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/materialdetail/MaterialDetailServiceImpl.java b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/materialdetail/MaterialDetailServiceImpl.java new file mode 100644 index 0000000..1145c54 --- /dev/null +++ b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/materialdetail/MaterialDetailServiceImpl.java @@ -0,0 +1,85 @@ +package com.zteits.urbanops.module.workorder.service.materialdetail; + +import cn.hutool.core.collection.CollUtil; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import com.zteits.urbanops.module.workorder.controller.admin.materialdetail.vo.*; +import com.zteits.urbanops.module.workorder.dal.dataobject.materialdetail.MaterialDetailDO; +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.common.pojo.PageParam; +import com.zteits.urbanops.framework.common.util.object.BeanUtils; + +import com.zteits.urbanops.module.workorder.dal.mysql.materialdetail.MaterialDetailMapper; + +import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.convertList; +import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.diffList; +import static com.zteits.urbanops.module.workorder.enums.ErrorCodeConstants.*; + +/** + * 工单耗材明细 Service 实现类 + * + * @author 超级管理员 + */ +@Service +@Validated +public class MaterialDetailServiceImpl implements MaterialDetailService { + + @Resource + private MaterialDetailMapper materialDetailMapper; + + @Override + public Long createMaterialDetail(MaterialDetailSaveReqVO createReqVO) { + // 插入 + MaterialDetailDO materialDetail = BeanUtils.toBean(createReqVO, MaterialDetailDO.class); + materialDetailMapper.insert(materialDetail); + + // 返回 + return materialDetail.getId(); + } + + @Override + public void updateMaterialDetail(MaterialDetailSaveReqVO updateReqVO) { + // 校验存在 + validateMaterialDetailExists(updateReqVO.getId()); + // 更新 + MaterialDetailDO updateObj = BeanUtils.toBean(updateReqVO, MaterialDetailDO.class); + materialDetailMapper.updateById(updateObj); + } + + @Override + public void deleteMaterialDetail(Long id) { + // 校验存在 + validateMaterialDetailExists(id); + // 删除 + materialDetailMapper.deleteById(id); + } + + @Override + public void deleteMaterialDetailListByIds(List ids) { + // 删除 + materialDetailMapper.deleteByIds(ids); + } + + + private void validateMaterialDetailExists(Long id) { + if (materialDetailMapper.selectById(id) == null) { + throw exception(MATERIAL_DETAIL_NOT_EXISTS); + } + } + + @Override + public MaterialDetailDO getMaterialDetail(Long id) { + return materialDetailMapper.selectById(id); + } + + @Override + public PageResult getMaterialDetailPage(MaterialDetailPageReqVO pageReqVO) { + return materialDetailMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/urbanops-module-workorder/src/main/resources/mapper/maininfo/MainInfoMapper.xml b/urbanops-module-workorder/src/main/resources/mapper/maininfo/MainInfoMapper.xml new file mode 100644 index 0000000..0693933 --- /dev/null +++ b/urbanops-module-workorder/src/main/resources/mapper/maininfo/MainInfoMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/urbanops-module-workorder/src/main/resources/mapper/mapper/attachment/AttachmentMapper.xml b/urbanops-module-workorder/src/main/resources/mapper/mapper/attachment/AttachmentMapper.xml new file mode 100644 index 0000000..29c87ff --- /dev/null +++ b/urbanops-module-workorder/src/main/resources/mapper/mapper/attachment/AttachmentMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/urbanops-module-workorder/src/main/resources/mapper/materialdetail/MaterialDetailMapper.xml b/urbanops-module-workorder/src/main/resources/mapper/materialdetail/MaterialDetailMapper.xml new file mode 100644 index 0000000..e182d04 --- /dev/null +++ b/urbanops-module-workorder/src/main/resources/mapper/materialdetail/MaterialDetailMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/urbanops-server/pom.xml b/urbanops-server/pom.xml index 566c7a6..19d1e1a 100644 --- a/urbanops-server/pom.xml +++ b/urbanops-server/pom.xml @@ -43,6 +43,13 @@ urbanops-module-garden ${revision} + + + + com.zteits.boot + urbanops-module-workorder + ${revision} + -- libgit2 0.21.4