Commit d5a9f42774ce92ca2809f3060ea9a6c499cf36ac
Merge remote-tracking branch 'origin/dev' into dev
Showing
25 changed files
with
1382 additions
and
26 deletions
urbanops-framework/urbanops-spring-boot-starter-excel/src/main/java/com/zteits/urbanops/framework/excel/core/convert/ListToStringConverter.java
0 → 100644
| 1 | +package com.zteits.urbanops.framework.excel.core.convert; | |
| 2 | +import cn.idev.excel.converters.Converter; | |
| 3 | +import cn.hutool.core.collection.CollectionUtil; | |
| 4 | +import cn.idev.excel.enums.CellDataTypeEnum; | |
| 5 | +import cn.idev.excel.metadata.GlobalConfiguration; | |
| 6 | +import cn.idev.excel.metadata.data.WriteCellData; | |
| 7 | +import cn.idev.excel.metadata.property.ExcelContentProperty; | |
| 8 | + | |
| 9 | +import java.util.List; | |
| 10 | + | |
| 11 | +/** | |
| 12 | + * List 转 Excel 字符串转换器(将List用逗号拼接成字符串) | |
| 13 | + */ | |
| 14 | +public class ListToStringConverter implements Converter<List<?>> { | |
| 15 | + | |
| 16 | + @Override | |
| 17 | + public Class<?> supportJavaTypeKey() { | |
| 18 | + // 声明支持的Java类型:List | |
| 19 | + return List.class; | |
| 20 | + } | |
| 21 | + | |
| 22 | + @Override | |
| 23 | + public CellDataTypeEnum supportExcelTypeKey() { | |
| 24 | + // Excel单元格类型:字符串 | |
| 25 | + return CellDataTypeEnum.STRING; | |
| 26 | + } | |
| 27 | + | |
| 28 | + @Override | |
| 29 | + public WriteCellData<?> convertToExcelData(List<?> value, ExcelContentProperty contentProperty, | |
| 30 | + GlobalConfiguration globalConfiguration) { | |
| 31 | + // 核心转换逻辑:List为空返回空字符串,否则用逗号拼接 | |
| 32 | + if (CollectionUtil.isEmpty(value)) { | |
| 33 | + return new WriteCellData<>(""); | |
| 34 | + } | |
| 35 | + String joinStr = String.join(",", value.stream() | |
| 36 | + .map(Object::toString) | |
| 37 | + .toArray(String[]::new)); | |
| 38 | + return new WriteCellData<>(joinStr); | |
| 39 | + } | |
| 40 | +} | |
| 0 | 41 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/emergencytask/EmergencyTaskController.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.controller.admin.emergencytask; | |
| 2 | + | |
| 3 | +import jodd.util.StringUtil; | |
| 4 | +import org.springframework.web.bind.annotation.*; | |
| 5 | +import jakarta.annotation.Resource; | |
| 6 | +import org.springframework.validation.annotation.Validated; | |
| 7 | +import org.springframework.security.access.prepost.PreAuthorize; | |
| 8 | +import io.swagger.v3.oas.annotations.tags.Tag; | |
| 9 | +import io.swagger.v3.oas.annotations.Parameter; | |
| 10 | +import io.swagger.v3.oas.annotations.Operation; | |
| 11 | + | |
| 12 | +import jakarta.validation.*; | |
| 13 | +import jakarta.servlet.http.*; | |
| 14 | +import java.util.*; | |
| 15 | +import java.io.IOException; | |
| 16 | + | |
| 17 | +import com.zteits.urbanops.framework.common.pojo.PageParam; | |
| 18 | +import com.zteits.urbanops.framework.common.pojo.PageResult; | |
| 19 | +import com.zteits.urbanops.framework.common.pojo.CommonResult; | |
| 20 | + | |
| 21 | +import static com.zteits.urbanops.framework.common.pojo.CommonResult.error; | |
| 22 | +import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; | |
| 23 | + | |
| 24 | +import com.zteits.urbanops.framework.excel.core.util.ExcelUtils; | |
| 25 | + | |
| 26 | +import com.zteits.urbanops.framework.apilog.core.annotation.ApiAccessLog; | |
| 27 | +import static com.zteits.urbanops.framework.apilog.core.enums.OperateTypeEnum.*; | |
| 28 | + | |
| 29 | +import com.zteits.urbanops.module.garden.controller.admin.emergencytask.vo.*; | |
| 30 | +import com.zteits.urbanops.module.garden.service.emergencytask.EmergencyTaskService; | |
| 31 | + | |
| 32 | +@Tag(name = "管理后台 - 抢险任务主") | |
| 33 | +@RestController | |
| 34 | +@RequestMapping("/garden/emergency-task") | |
| 35 | +@Validated | |
| 36 | +public class EmergencyTaskController { | |
| 37 | + | |
| 38 | + @Resource | |
| 39 | + private EmergencyTaskService emergencyTaskService; | |
| 40 | + | |
| 41 | + @PostMapping("/create") | |
| 42 | + @Operation(summary = "创建抢险任务主") | |
| 43 | + @PreAuthorize("@ss.hasPermission('garden:emergency-task:create')") | |
| 44 | + public CommonResult<Long> createEmergencyTask(@Valid @RequestBody EmergencyTaskSaveReqVO createReqVO) { | |
| 45 | + return success(emergencyTaskService.createEmergencyTask(createReqVO)); | |
| 46 | + } | |
| 47 | + | |
| 48 | + @PutMapping("/update") | |
| 49 | + @Operation(summary = "更新抢险任务主") | |
| 50 | + @PreAuthorize("@ss.hasPermission('garden:emergency-task:update')") | |
| 51 | + public CommonResult<Boolean> updateEmergencyTask(@Valid @RequestBody EmergencyTaskSaveReqVO updateReqVO) { | |
| 52 | + emergencyTaskService.updateEmergencyTask(updateReqVO); | |
| 53 | + return success(true); | |
| 54 | + } | |
| 55 | + | |
| 56 | + @PostMapping("/approval") | |
| 57 | + @Operation(summary = "抢险任务审批") | |
| 58 | + @PreAuthorize("@ss.hasPermission('garden:emergency-task:approval')") | |
| 59 | + public CommonResult<Integer> approvalEmergencyTask(@Valid @RequestBody EmergencyTaskApprovalReqVO createReqVO) { | |
| 60 | + return success(emergencyTaskService.approvalEmergencyTask(createReqVO)); | |
| 61 | + } | |
| 62 | + | |
| 63 | + @DeleteMapping("/delete/task_no") | |
| 64 | + @Operation(summary = "删除抢险任务主") | |
| 65 | + @Parameter(name = "task_no", description = "编号", required = true) | |
| 66 | + @PreAuthorize("@ss.hasPermission('garden:emergency-task:delete')") | |
| 67 | + public CommonResult<Boolean> deleteEmergencyTask(@RequestParam("task_no") String taskNo) { | |
| 68 | + emergencyTaskService.deleteEmergencyTaskByTaskNo(taskNo); | |
| 69 | + return success(true); | |
| 70 | + } | |
| 71 | + | |
| 72 | + @DeleteMapping("/delete-list") | |
| 73 | + @Parameter(name = "ids", description = "编号", required = true) | |
| 74 | + @Operation(summary = "批量删除抢险任务主") | |
| 75 | + @PreAuthorize("@ss.hasPermission('garden:emergency-task:delete')") | |
| 76 | + public CommonResult<Boolean> deleteEmergencyTaskList(@RequestParam("ids") List<Long> ids) { | |
| 77 | + emergencyTaskService.deleteEmergencyTaskListByIds(ids); | |
| 78 | + return success(true); | |
| 79 | + } | |
| 80 | + | |
| 81 | + @GetMapping("/get/task_no") | |
| 82 | + @Operation(summary = "获得抢险任务主") | |
| 83 | + @Parameter(name = "task_no", description = "编号", required = true, example = "1024") | |
| 84 | + @PreAuthorize("@ss.hasPermission('garden:emergency-task:query')") | |
| 85 | + public CommonResult<EmergencyTaskRespVO> getEmergencyTask(@RequestParam("task_no") String taskNo) { | |
| 86 | + EmergencyTaskRespVO emergencyTask = emergencyTaskService.getEmergencyTaskByTaskNo(taskNo); | |
| 87 | + return success(emergencyTask); | |
| 88 | + } | |
| 89 | + | |
| 90 | + @GetMapping("/page") | |
| 91 | + @Operation(summary = "获得抢险任务主分页") | |
| 92 | + //@PreAuthorize("@ss.hasPermission('garden:emergency-task:query')") | |
| 93 | + public CommonResult<PageResult<EmergencyTaskRespVO>> getEmergencyTaskPage(@Valid EmergencyTaskPageReqVO pageReqVO) { | |
| 94 | + PageResult<EmergencyTaskRespVO> pageResult = emergencyTaskService.getEmergencyTaskPage(pageReqVO); | |
| 95 | + return success(pageResult); | |
| 96 | + } | |
| 97 | + | |
| 98 | + @GetMapping("/export-excel") | |
| 99 | + @Operation(summary = "导出抢险任务主 Excel") | |
| 100 | + //@PreAuthorize("@ss.hasPermission('garden:emergency-task:export')") | |
| 101 | + @ApiAccessLog(operateType = EXPORT) | |
| 102 | + public void exportEmergencyTaskExcel(@Valid EmergencyTaskPageReqVO pageReqVO, | |
| 103 | + HttpServletResponse response) throws IOException { | |
| 104 | + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); | |
| 105 | + List<EmergencyTaskRespVO> list = emergencyTaskService.getEmergencyTaskPage(pageReqVO).getList(); | |
| 106 | + // 导出 Excel | |
| 107 | + ExcelUtils.write(response, "抢险任务主.xls", "数据", EmergencyTaskRespVO.class, list); | |
| 108 | + } | |
| 109 | + | |
| 110 | +} | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/emergencytask/vo/EmergencyMachineryPageReqVO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.controller.admin.emergencytask.vo; | |
| 2 | + | |
| 3 | +import lombok.*; | |
| 4 | +import java.util.*; | |
| 5 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 6 | +import com.zteits.urbanops.framework.common.pojo.PageParam; | |
| 7 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 8 | +import java.time.LocalDateTime; | |
| 9 | + | |
| 10 | +import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | |
| 11 | + | |
| 12 | +@Schema(description = "管理后台 - 抢险机械子分页 Request VO") | |
| 13 | +@Data | |
| 14 | +public class EmergencyMachineryPageReqVO extends PageParam { | |
| 15 | + | |
| 16 | + @Schema(description = "关联任务主表ID", example = "24066") | |
| 17 | + private Long taskId; | |
| 18 | + | |
| 19 | + @Schema(description = "机械名称(如:三轮车)", example = "21485") | |
| 20 | + private Integer machineryNameId; | |
| 21 | + | |
| 22 | + @Schema(description = "机械数量", example = "28764") | |
| 23 | + private Integer machineryCount; | |
| 24 | + | |
| 25 | + @Schema(description = "创建者", example = "李四") | |
| 26 | + private String creatorName; | |
| 27 | + | |
| 28 | + @Schema(description = "创建时间") | |
| 29 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 30 | + private LocalDateTime[] createTime; | |
| 31 | + | |
| 32 | + @Schema(description = "更新者", example = "张三") | |
| 33 | + private String updaterName; | |
| 34 | + | |
| 35 | +} | |
| 0 | 36 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/emergencytask/vo/EmergencyMachineryRespVO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.controller.admin.emergencytask.vo; | |
| 2 | + | |
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 4 | +import lombok.*; | |
| 5 | +import java.util.*; | |
| 6 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 7 | +import java.time.LocalDateTime; | |
| 8 | +import cn.idev.excel.annotation.*; | |
| 9 | + | |
| 10 | +@Schema(description = "管理后台 - 抢险机械子 Response VO") | |
| 11 | +@Data | |
| 12 | +@ExcelIgnoreUnannotated | |
| 13 | +public class EmergencyMachineryRespVO { | |
| 14 | + | |
| 15 | + @Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1541") | |
| 16 | + @ExcelProperty("主键ID") | |
| 17 | + private Long id; | |
| 18 | + | |
| 19 | + @Schema(description = "关联任务主表ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "24066") | |
| 20 | + @ExcelProperty("关联任务主表ID") | |
| 21 | + private Long taskId; | |
| 22 | + | |
| 23 | + @Schema(description = "机械名称(如:三轮车)", requiredMode = Schema.RequiredMode.REQUIRED, example = "21485") | |
| 24 | + @ExcelProperty("机械名称(如:三轮车)") | |
| 25 | + private Integer machineryNameId; | |
| 26 | + | |
| 27 | + @Schema(description = "机械数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "28764") | |
| 28 | + @ExcelProperty("机械数量") | |
| 29 | + private Integer machineryCount; | |
| 30 | + | |
| 31 | + @Schema(description = "创建者", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") | |
| 32 | + @ExcelProperty("创建者") | |
| 33 | + private String creatorName; | |
| 34 | + | |
| 35 | + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 36 | + @ExcelProperty("创建时间") | |
| 37 | + private LocalDateTime createTime; | |
| 38 | + | |
| 39 | + @Schema(description = "更新者", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") | |
| 40 | + @ExcelProperty("更新者") | |
| 41 | + private String updaterName; | |
| 42 | + | |
| 43 | +} | |
| 0 | 44 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/emergencytask/vo/EmergencyMachinerySaveReqVO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.controller.admin.emergencytask.vo; | |
| 2 | + | |
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 4 | +import lombok.*; | |
| 5 | +import java.util.*; | |
| 6 | +import jakarta.validation.constraints.*; | |
| 7 | + | |
| 8 | +@Schema(description = "管理后台 - 抢险机械子新增/修改 Request VO") | |
| 9 | +@Data | |
| 10 | +public class EmergencyMachinerySaveReqVO { | |
| 11 | + | |
| 12 | + @Schema(description = "机械名称(如:三轮车)", requiredMode = Schema.RequiredMode.REQUIRED, example = "21485") | |
| 13 | + @NotNull(message = "机械名称(如:三轮车)不能为空") | |
| 14 | + private Integer machineryNameId; | |
| 15 | + | |
| 16 | + @Schema(description = "机械数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "28764") | |
| 17 | + @NotNull(message = "机械数量不能为空") | |
| 18 | + private Integer machineryCount; | |
| 19 | + | |
| 20 | +} | |
| 0 | 21 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/emergencytask/vo/EmergencyTaskApprovalReqVO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.controller.admin.emergencytask.vo; | |
| 2 | + | |
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 4 | +import jakarta.validation.constraints.*; | |
| 5 | +import lombok.Data; | |
| 6 | + | |
| 7 | +@Schema(description = "管理后台 - 抢险任务主新增/修改 Request VO") | |
| 8 | +@Data | |
| 9 | +public class EmergencyTaskApprovalReqVO { | |
| 10 | + | |
| 11 | + @Schema(description = "任务编号(唯一标识,如生成规则:TASK+时间戳)", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 12 | + @NotEmpty(message = "任务编号(唯一标识,如生成规则:TASK+时间戳)不能为空") | |
| 13 | + private String taskNo; | |
| 14 | + | |
| 15 | + | |
| 16 | + @Schema(description = "案件状态 1-待提交 2-待审核 3-驳回 4-关闭;5-完结", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | |
| 17 | + @NotNull(message = "案件状态 1-待提交 2-待审核 3-驳回 4-关闭;5-完结 不能为空") | |
| 18 | + @Min(value = 1, message = "案件状态 1-待提交 2-待审核 3-驳回 4-关闭;5-完结不能小于 1") | |
| 19 | + @Max(value = 5, message = "案件状态 1-待提交 2-待审核 3-驳回 4-关闭;5-完结不能大于 5") | |
| 20 | + private Integer busiStatus; | |
| 21 | + | |
| 22 | + @Schema(description = "审批备注", requiredMode = Schema.RequiredMode.REQUIRED, example = "审批备注") | |
| 23 | + private String approvalRemarks; | |
| 24 | + | |
| 25 | +} | |
| 0 | 26 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/emergencytask/vo/EmergencyTaskPageReqVO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.controller.admin.emergencytask.vo; | |
| 2 | + | |
| 3 | +import lombok.*; | |
| 4 | + | |
| 5 | +import java.time.LocalDate; | |
| 6 | +import java.util.*; | |
| 7 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 8 | +import com.zteits.urbanops.framework.common.pojo.PageParam; | |
| 9 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 10 | +import java.time.LocalDateTime; | |
| 11 | + | |
| 12 | +import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY; | |
| 13 | +import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | |
| 14 | + | |
| 15 | +@Schema(description = "管理后台 - 抢险任务主分页 Request VO") | |
| 16 | +@Data | |
| 17 | +public class EmergencyTaskPageReqVO extends PageParam { | |
| 18 | + | |
| 19 | + @Schema(description = "任务编号(唯一标识,如生成规则:TASK+时间戳)") | |
| 20 | + private String taskNo; | |
| 21 | + | |
| 22 | + @Schema(description = "险情类型(如:树木倒伏)", example = "5209") | |
| 23 | + private Integer emergencyTypeId; | |
| 24 | + | |
| 25 | + @Schema(description = "险情危害(如:无)", example = "16325") | |
| 26 | + private Integer emergencyHarmId; | |
| 27 | + | |
| 28 | + @Schema(description = "树木权属(如:专业权属)", example = "19498") | |
| 29 | + private Integer treeOwnershipId; | |
| 30 | + | |
| 31 | + @Schema(description = "险情地点") | |
| 32 | + private String emergencyLocation; | |
| 33 | + | |
| 34 | + @Schema(description = "抢险开始时间") | |
| 35 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY) | |
| 36 | + private LocalDate startTime; | |
| 37 | + | |
| 38 | + @Schema(description = "抢险结束时间") | |
| 39 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY) | |
| 40 | + private LocalDate endTime; | |
| 41 | + | |
| 42 | + | |
| 43 | + @Schema(description = "案件状态 1-待提交 2-待审核 3-驳回 4-关闭;5-完结", example = "1") | |
| 44 | + private Integer busiStatus; | |
| 45 | + | |
| 46 | + @Schema(description = "归属(一级部门id)", example = "6353") | |
| 47 | + private Long companyId; | |
| 48 | + | |
| 49 | +} | |
| 0 | 50 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/emergencytask/vo/EmergencyTaskRespVO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.controller.admin.emergencytask.vo; | |
| 2 | + | |
| 3 | +import com.zteits.urbanops.framework.excel.core.convert.ListToStringConverter; | |
| 4 | +import com.zteits.urbanops.module.garden.dal.dataobject.emergencytask.EmergencyMachineryDO; | |
| 5 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 6 | +import lombok.*; | |
| 7 | +import java.util.*; | |
| 8 | +import java.time.LocalDateTime; | |
| 9 | +import cn.idev.excel.annotation.*; | |
| 10 | + | |
| 11 | +@Schema(description = "管理后台 - 抢险任务主 Response VO") | |
| 12 | +@Data | |
| 13 | +@ExcelIgnoreUnannotated | |
| 14 | +public class EmergencyTaskRespVO { | |
| 15 | + | |
| 16 | + @Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "10092") | |
| 17 | + @ExcelProperty("主键ID") | |
| 18 | + private Long id; | |
| 19 | + | |
| 20 | + @Schema(description = "任务编号(唯一标识,如生成规则:TASK+时间戳)", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 21 | + @ExcelProperty("任务编号(唯一标识,如生成规则:TASK+时间戳)") | |
| 22 | + private String taskNo; | |
| 23 | + | |
| 24 | + @Schema(description = "发现险情时间", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 25 | + @ExcelProperty("发现险情时间") | |
| 26 | + private LocalDateTime discoveryTime; | |
| 27 | + | |
| 28 | + @Schema(description = "险情类型(如:树木倒伏)", requiredMode = Schema.RequiredMode.REQUIRED, example = "5209") | |
| 29 | + @ExcelProperty("险情类型:1:树木倒伏 2:树木折枝") | |
| 30 | + private Integer emergencyTypeId; | |
| 31 | + | |
| 32 | + @Schema(description = "险情危害(如:无)", requiredMode = Schema.RequiredMode.REQUIRED, example = "16325") | |
| 33 | + @ExcelProperty("险情危害(如:无)") | |
| 34 | + private Integer emergencyHarmId; | |
| 35 | + | |
| 36 | + @Schema(description = "树木权属(如:专业权属)", requiredMode = Schema.RequiredMode.REQUIRED, example = "19498") | |
| 37 | + @ExcelProperty("树木权属 1:砸车 2:砸房 3:砸人 4:无") | |
| 38 | + private Integer treeOwnershipId; | |
| 39 | + | |
| 40 | + @Schema(description = "险情地点", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 41 | + @ExcelProperty("险情地点") | |
| 42 | + private String emergencyLocation; | |
| 43 | + | |
| 44 | + @Schema(description = "上报人", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 45 | + @ExcelProperty("上报人") | |
| 46 | + private String reporter; | |
| 47 | + | |
| 48 | + @Schema(description = "联系电话", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 49 | + @ExcelProperty("联系电话") | |
| 50 | + private String contactPhone; | |
| 51 | + | |
| 52 | + @Schema(description = "抢险开始时间", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 53 | + @ExcelProperty("抢险开始时间") | |
| 54 | + private LocalDateTime rescueStartTime; | |
| 55 | + | |
| 56 | + @Schema(description = "抢险中照片", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 57 | + @ExcelProperty(value="抢险中照片", converter = ListToStringConverter.class) | |
| 58 | + private List<String> emergencyImg; | |
| 59 | + | |
| 60 | + @Schema(description = "树种(如:国槐)") | |
| 61 | + @ExcelProperty("树种(如:国槐)") | |
| 62 | + private String treeSpecies; | |
| 63 | + | |
| 64 | + @Schema(description = "树木规格(如:胸径20厘米)") | |
| 65 | + @ExcelProperty("树木规格(如:胸径20厘米)") | |
| 66 | + private String treeSpec; | |
| 67 | + | |
| 68 | + @Schema(description = "抢险完成时间", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 69 | + @ExcelProperty("抢险完成时间") | |
| 70 | + private LocalDateTime rescueCompleteTime; | |
| 71 | + | |
| 72 | + @Schema(description = "出动人员数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "3371") | |
| 73 | + @ExcelProperty("出动人员数量") | |
| 74 | + private Integer personnelCount; | |
| 75 | + | |
| 76 | + @Schema(description = "抢险结束照片", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 77 | + @ExcelProperty(value="抢险结束照片", converter = ListToStringConverter.class) | |
| 78 | + private List<String> emergencyEndImg; | |
| 79 | + | |
| 80 | + @Schema(description = "备注") | |
| 81 | + @ExcelProperty("备注") | |
| 82 | + private String remarks; | |
| 83 | + | |
| 84 | + @Schema(description = "案件状态 1-待提交 2-待审核 3-驳回 4-关闭;5-完结", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | |
| 85 | + @ExcelProperty("案件状态 1-待提交 2-待审核 3-驳回 4-关闭;5-完结") | |
| 86 | + private Integer busiStatus; | |
| 87 | + | |
| 88 | + @Schema(description = "工作流审批状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | |
| 89 | + @ExcelProperty("工作流审批状态") | |
| 90 | + private Integer status; | |
| 91 | + | |
| 92 | + @Schema(description = "流程实例的编号", example = "30197") | |
| 93 | + @ExcelProperty("流程实例的编号") | |
| 94 | + private String processInstanceId; | |
| 95 | + | |
| 96 | + @Schema(description = "审批人ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "20789") | |
| 97 | + @ExcelProperty("审批人ID") | |
| 98 | + private String approvalUserId; | |
| 99 | + | |
| 100 | + @Schema(description = "审批人", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") | |
| 101 | + @ExcelProperty("审批人") | |
| 102 | + private String approvalUserName; | |
| 103 | + | |
| 104 | + @Schema(description = "审批备注", requiredMode = Schema.RequiredMode.REQUIRED, example = "审批备注") | |
| 105 | + @ExcelProperty("审批备注") | |
| 106 | + private String approvalRemarks; | |
| 107 | + | |
| 108 | + @Schema(description = "归属(一级部门id)", requiredMode = Schema.RequiredMode.REQUIRED, example = "6353") | |
| 109 | + @ExcelProperty("归属(一级部门id)") | |
| 110 | + private Long companyId; | |
| 111 | + | |
| 112 | + @Schema(description = "部门ID(道路负责部门id)", requiredMode = Schema.RequiredMode.REQUIRED, example = "27559") | |
| 113 | + @ExcelProperty("部门ID(道路负责部门id)") | |
| 114 | + private Long deptId; | |
| 115 | + | |
| 116 | + @Schema(description = "创建者", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") | |
| 117 | + @ExcelProperty("创建者") | |
| 118 | + private String creatorName; | |
| 119 | + | |
| 120 | + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 121 | + @ExcelProperty("创建时间") | |
| 122 | + private LocalDateTime createTime; | |
| 123 | + | |
| 124 | + @Schema(description = "更新者", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") | |
| 125 | + @ExcelProperty("更新者") | |
| 126 | + private String updaterName; | |
| 127 | + | |
| 128 | + @ExcelProperty(value="机械信息", converter = ListToStringConverter.class) | |
| 129 | + private List<EmergencyMachineryDO> emergencyMachineryList; | |
| 130 | + | |
| 131 | + @Schema(description = "归属(一级部门id)", requiredMode = Schema.RequiredMode.REQUIRED, example = "20800") | |
| 132 | + @ExcelProperty("归属(一级部门id)") | |
| 133 | + private String companyName; | |
| 134 | + | |
| 135 | + | |
| 136 | + @Schema(description = "部门(道路负责部门id)", requiredMode = Schema.RequiredMode.REQUIRED, example = "12055") | |
| 137 | + @ExcelProperty("部门") | |
| 138 | + private String deptName; | |
| 139 | + | |
| 140 | +} | |
| 0 | 141 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/emergencytask/vo/EmergencyTaskSaveReqVO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.controller.admin.emergencytask.vo; | |
| 2 | + | |
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 4 | +import lombok.*; | |
| 5 | +import java.util.*; | |
| 6 | +import jakarta.validation.constraints.*; | |
| 7 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 8 | +import java.time.LocalDateTime; | |
| 9 | + | |
| 10 | +@Schema(description = "管理后台 - 抢险任务主新增/修改 Request VO") | |
| 11 | +@Data | |
| 12 | +public class EmergencyTaskSaveReqVO { | |
| 13 | + | |
| 14 | + @Schema(description = "任务编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "30197") | |
| 15 | + private String taskNo; | |
| 16 | + | |
| 17 | + @Schema(description = "发现险情时间", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 18 | + @NotNull(message = "发现险情时间不能为空") | |
| 19 | + private LocalDateTime discoveryTime; | |
| 20 | + | |
| 21 | + @Schema(description = "险情类型(如:树木倒伏)", requiredMode = Schema.RequiredMode.REQUIRED, example = "5209") | |
| 22 | + @NotNull(message = "险情类型(如:树木倒伏)不能为空") | |
| 23 | + private Integer emergencyTypeId; | |
| 24 | + | |
| 25 | + @Schema(description = "险情危害(如:无)", requiredMode = Schema.RequiredMode.REQUIRED, example = "16325") | |
| 26 | + @NotNull(message = "险情危害(如:无)不能为空") | |
| 27 | + private Integer emergencyHarmId; | |
| 28 | + | |
| 29 | + @Schema(description = "树木权属(如:专业权属)", requiredMode = Schema.RequiredMode.REQUIRED, example = "19498") | |
| 30 | + @NotNull(message = "树木权属(如:专业权属)不能为空") | |
| 31 | + private Integer treeOwnershipId; | |
| 32 | + | |
| 33 | + @Schema(description = "险情地点", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 34 | + @NotEmpty(message = "险情地点不能为空") | |
| 35 | + private String emergencyLocation; | |
| 36 | + | |
| 37 | + @Schema(description = "上报人", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 38 | + @NotEmpty(message = "上报人不能为空") | |
| 39 | + private String reporter; | |
| 40 | + | |
| 41 | + @Schema(description = "联系电话", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 42 | + @NotEmpty(message = "联系电话不能为空") | |
| 43 | + @Pattern(regexp = "^1[3-9]\\d{9}$", message = "联系电话格式不正确,应为 11 位手机号") | |
| 44 | + private String contactPhone; | |
| 45 | + | |
| 46 | + @Schema(description = "抢险开始时间", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 47 | + @NotNull(message = "抢险开始时间不能为空") | |
| 48 | + private LocalDateTime rescueStartTime; | |
| 49 | + | |
| 50 | + @Schema(description = "抢险中照片", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 51 | + @NotNull(message = "抢险中照片不能为空") | |
| 52 | + @Size(min = 1, message = "抢险中照片最少1张") | |
| 53 | + private List<String> emergencyImg; | |
| 54 | + | |
| 55 | + @Schema(description = "树种(如:国槐)") | |
| 56 | + private String treeSpecies; | |
| 57 | + | |
| 58 | + @Schema(description = "树木规格(如:胸径20厘米)") | |
| 59 | + private String treeSpec; | |
| 60 | + | |
| 61 | + @Schema(description = "抢险完成时间", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 62 | + @NotNull(message = "抢险完成时间不能为空") | |
| 63 | + private LocalDateTime rescueCompleteTime; | |
| 64 | + | |
| 65 | + @Schema(description = "出动人员数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "3371") | |
| 66 | + @NotNull(message = "出动人员数量不能为空") | |
| 67 | + private Integer personnelCount; | |
| 68 | + | |
| 69 | + @Schema(description = "抢险结束照片", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 70 | + private List<String> emergencyEndImg; | |
| 71 | + | |
| 72 | + @Schema(description = "备注") | |
| 73 | + private String remarks; | |
| 74 | + | |
| 75 | + @Schema(description = "案件状态 1-待提交 2-待审核 3-驳回 4-关闭;5-完结", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | |
| 76 | + @NotNull(message = "案件状态 1-待提交 2-待审核 3-驳回 4-关闭;5-完结不能为空") | |
| 77 | + private Integer busiStatus; | |
| 78 | + | |
| 79 | + @Schema(description = "工作流审批状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | |
| 80 | + @NotNull(message = "工作流审批状态不能为空") | |
| 81 | + private Integer status; | |
| 82 | + | |
| 83 | + @Schema(description = "流程实例的编号", example = "30197") | |
| 84 | + private String processInstanceId; | |
| 85 | + | |
| 86 | + @Schema(description = "审批人ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "20789") | |
| 87 | + @NotEmpty(message = "审批人ID不能为空") | |
| 88 | + private String approvalUserId; | |
| 89 | + | |
| 90 | + @Schema(description = "审批人", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") | |
| 91 | + @NotEmpty(message = "审批人不能为空") | |
| 92 | + private String approvalUserName; | |
| 93 | + | |
| 94 | + @Schema(description = "使用机械", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") | |
| 95 | + private List<EmergencyMachinerySaveReqVO> emergencyMachineryList; | |
| 96 | + | |
| 97 | +} | |
| 0 | 98 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/emergencytask/EmergencyMachineryDO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.dal.dataobject.emergencytask; | |
| 2 | + | |
| 3 | +import lombok.*; | |
| 4 | +import java.util.*; | |
| 5 | +import java.time.LocalDateTime; | |
| 6 | +import java.time.LocalDateTime; | |
| 7 | +import com.baomidou.mybatisplus.annotation.*; | |
| 8 | +import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * 抢险机械子 DO | |
| 12 | + * | |
| 13 | + * @author 超级管理员 | |
| 14 | + */ | |
| 15 | +@TableName("garden_emergency_machinery") | |
| 16 | +@KeySequence("garden_emergency_machinery_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 | |
| 17 | +@Data | |
| 18 | +@EqualsAndHashCode(callSuper = true) | |
| 19 | +@ToString(callSuper = true) | |
| 20 | +@Builder | |
| 21 | +@NoArgsConstructor | |
| 22 | +@AllArgsConstructor | |
| 23 | +public class EmergencyMachineryDO extends BaseDO { | |
| 24 | + | |
| 25 | + /** | |
| 26 | + * 主键ID | |
| 27 | + */ | |
| 28 | + @TableId | |
| 29 | + private Long id; | |
| 30 | + /** | |
| 31 | + * 任务编号(唯一标识,如生成规则:TASK+时间戳) | |
| 32 | + */ | |
| 33 | + private String taskNo; | |
| 34 | + /** | |
| 35 | + * 机械名称(如:三轮车) | |
| 36 | + */ | |
| 37 | + private Integer machineryNameId; | |
| 38 | + /** | |
| 39 | + * 机械数量 | |
| 40 | + */ | |
| 41 | + private Integer machineryCount; | |
| 42 | + /** | |
| 43 | + * 创建者 | |
| 44 | + */ | |
| 45 | + private String creatorName; | |
| 46 | + /** | |
| 47 | + * 更新者 | |
| 48 | + */ | |
| 49 | + private String updaterName; | |
| 50 | + | |
| 51 | + | |
| 52 | +} | |
| 0 | 53 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/emergencytask/EmergencyTaskDO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.dal.dataobject.emergencytask; | |
| 2 | + | |
| 3 | +import com.zteits.urbanops.framework.mybatis.core.type.StringArrayToListTypeHandler; | |
| 4 | +import com.zteits.urbanops.framework.mybatis.core.type.StringListTypeHandler; | |
| 5 | +import lombok.*; | |
| 6 | +import java.util.*; | |
| 7 | +import java.time.LocalDateTime; | |
| 8 | +import java.time.LocalDateTime; | |
| 9 | +import java.time.LocalDateTime; | |
| 10 | +import java.time.LocalDateTime; | |
| 11 | +import java.time.LocalDateTime; | |
| 12 | +import com.baomidou.mybatisplus.annotation.*; | |
| 13 | +import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO; | |
| 14 | + | |
| 15 | +/** | |
| 16 | + * 抢险任务主 DO | |
| 17 | + * | |
| 18 | + * @author 超级管理员 | |
| 19 | + */ | |
| 20 | +@TableName(value="garden_emergency_task", autoResultMap = true) | |
| 21 | +@KeySequence("garden_emergency_task_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 | |
| 22 | +@Data | |
| 23 | +@EqualsAndHashCode(callSuper = true) | |
| 24 | +@ToString(callSuper = true) | |
| 25 | +@Builder | |
| 26 | +@NoArgsConstructor | |
| 27 | +@AllArgsConstructor | |
| 28 | +public class EmergencyTaskDO extends BaseDO { | |
| 29 | + | |
| 30 | + /** | |
| 31 | + * 主键ID | |
| 32 | + */ | |
| 33 | + @TableId | |
| 34 | + private Long id; | |
| 35 | + /** | |
| 36 | + * 任务编号(唯一标识,如生成规则:TASK+时间戳) | |
| 37 | + */ | |
| 38 | + private String taskNo; | |
| 39 | + /** | |
| 40 | + * 发现险情时间 | |
| 41 | + */ | |
| 42 | + private LocalDateTime discoveryTime; | |
| 43 | + /** | |
| 44 | + * 险情类型(如:树木倒伏) | |
| 45 | + */ | |
| 46 | + private Integer emergencyTypeId; | |
| 47 | + /** | |
| 48 | + * 险情危害(如:无) | |
| 49 | + */ | |
| 50 | + private Integer emergencyHarmId; | |
| 51 | + /** | |
| 52 | + * 树木权属(如:专业权属) | |
| 53 | + */ | |
| 54 | + private Integer treeOwnershipId; | |
| 55 | + /** | |
| 56 | + * 险情地点 | |
| 57 | + */ | |
| 58 | + private String emergencyLocation; | |
| 59 | + /** | |
| 60 | + * 上报人 | |
| 61 | + */ | |
| 62 | + private String reporter; | |
| 63 | + /** | |
| 64 | + * 联系电话 | |
| 65 | + */ | |
| 66 | + private String contactPhone; | |
| 67 | + /** | |
| 68 | + * 抢险开始时间 | |
| 69 | + */ | |
| 70 | + private LocalDateTime rescueStartTime; | |
| 71 | + /** | |
| 72 | + * 抢险中照片 | |
| 73 | + */ | |
| 74 | + @TableField(typeHandler = StringArrayToListTypeHandler.class) | |
| 75 | + private List<String> emergencyImg; | |
| 76 | + /** | |
| 77 | + * 树种(如:国槐) | |
| 78 | + */ | |
| 79 | + private String treeSpecies; | |
| 80 | + /** | |
| 81 | + * 树木规格(如:胸径20厘米) | |
| 82 | + */ | |
| 83 | + private String treeSpec; | |
| 84 | + /** | |
| 85 | + * 抢险完成时间 | |
| 86 | + */ | |
| 87 | + private LocalDateTime rescueCompleteTime; | |
| 88 | + /** | |
| 89 | + * 出动人员数量 | |
| 90 | + */ | |
| 91 | + private Integer personnelCount; | |
| 92 | + /** | |
| 93 | + * 抢险结束照片 | |
| 94 | + */ | |
| 95 | + @TableField(typeHandler = StringArrayToListTypeHandler.class) | |
| 96 | + private List<String> emergencyEndImg; | |
| 97 | + /** | |
| 98 | + * 备注 | |
| 99 | + */ | |
| 100 | + private String remarks; | |
| 101 | + /** | |
| 102 | + * 案件状态 1-待提交 2-待审核 3-驳回 4-关闭;5-完结 | |
| 103 | + */ | |
| 104 | + private Integer busiStatus; | |
| 105 | + /** | |
| 106 | + * 工作流审批状态 | |
| 107 | + */ | |
| 108 | + private Integer status; | |
| 109 | + /** | |
| 110 | + * 流程实例的编号 | |
| 111 | + */ | |
| 112 | + private String processInstanceId; | |
| 113 | + /** | |
| 114 | + * 审批人ID | |
| 115 | + */ | |
| 116 | + private String approvalUserId; | |
| 117 | + /** | |
| 118 | + * 审批人 | |
| 119 | + */ | |
| 120 | + private String approvalUserName; | |
| 121 | + | |
| 122 | + /** | |
| 123 | + * 审批备注 | |
| 124 | + */ | |
| 125 | + private String approvalRemarks; | |
| 126 | + /** | |
| 127 | + * 归属(一级部门id) | |
| 128 | + */ | |
| 129 | + private Long companyId; | |
| 130 | + /** | |
| 131 | + * 部门ID(道路负责部门id) | |
| 132 | + */ | |
| 133 | + private Long deptId; | |
| 134 | + /** | |
| 135 | + * 创建者 | |
| 136 | + */ | |
| 137 | + private String creatorName; | |
| 138 | + /** | |
| 139 | + * 更新者 | |
| 140 | + */ | |
| 141 | + private String updaterName; | |
| 142 | + | |
| 143 | + | |
| 144 | +} | |
| 0 | 145 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/emergencytask/EmergencyMachineryMapper.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.dal.mysql.emergencytask; | |
| 2 | + | |
| 3 | +import java.util.*; | |
| 4 | + | |
| 5 | +import com.zteits.urbanops.framework.common.pojo.PageResult; | |
| 6 | +import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; | |
| 7 | +import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; | |
| 8 | +import com.zteits.urbanops.module.garden.dal.dataobject.emergencytask.EmergencyMachineryDO; | |
| 9 | +import org.apache.ibatis.annotations.Mapper; | |
| 10 | +import com.zteits.urbanops.module.garden.controller.admin.emergencytask.vo.*; | |
| 11 | +import org.apache.ibatis.annotations.Param; | |
| 12 | + | |
| 13 | +/** | |
| 14 | + * 抢险机械子 Mapper | |
| 15 | + * | |
| 16 | + * @author 超级管理员 | |
| 17 | + */ | |
| 18 | +@Mapper | |
| 19 | +public interface EmergencyMachineryMapper extends BaseMapperX<EmergencyMachineryDO> { | |
| 20 | + | |
| 21 | + default PageResult<EmergencyMachineryDO> selectPage(EmergencyMachineryPageReqVO reqVO) { | |
| 22 | + return selectPage(reqVO, new LambdaQueryWrapperX<EmergencyMachineryDO>() | |
| 23 | + .eqIfPresent(EmergencyMachineryDO::getMachineryNameId, reqVO.getMachineryNameId()) | |
| 24 | + .eqIfPresent(EmergencyMachineryDO::getMachineryCount, reqVO.getMachineryCount()) | |
| 25 | + .likeIfPresent(EmergencyMachineryDO::getCreatorName, reqVO.getCreatorName()) | |
| 26 | + .betweenIfPresent(EmergencyMachineryDO::getCreateTime, reqVO.getCreateTime()) | |
| 27 | + .likeIfPresent(EmergencyMachineryDO::getUpdaterName, reqVO.getUpdaterName()) | |
| 28 | + .orderByDesc(EmergencyMachineryDO::getId)); | |
| 29 | + } | |
| 30 | + | |
| 31 | + int deleteByTaskNo(@Param("taskNo") String taskNo); | |
| 32 | + | |
| 33 | +} | |
| 0 | 34 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/emergencytask/EmergencyTaskMapper.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.dal.mysql.emergencytask; | |
| 2 | + | |
| 3 | +import java.time.LocalDate; | |
| 4 | +import java.time.LocalDateTime; | |
| 5 | +import java.time.LocalTime; | |
| 6 | +import java.util.*; | |
| 7 | + | |
| 8 | +import com.zteits.urbanops.framework.common.pojo.PageResult; | |
| 9 | +import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; | |
| 10 | +import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; | |
| 11 | +import com.zteits.urbanops.module.garden.dal.dataobject.emergencytask.EmergencyTaskDO; | |
| 12 | +import org.apache.ibatis.annotations.Mapper; | |
| 13 | +import com.zteits.urbanops.module.garden.controller.admin.emergencytask.vo.*; | |
| 14 | +import org.apache.ibatis.annotations.Param; | |
| 15 | + | |
| 16 | +/** | |
| 17 | + * 抢险任务主 Mapper | |
| 18 | + * | |
| 19 | + * @author 超级管理员 | |
| 20 | + */ | |
| 21 | +@Mapper | |
| 22 | +public interface EmergencyTaskMapper extends BaseMapperX<EmergencyTaskDO> { | |
| 23 | + | |
| 24 | + default PageResult<EmergencyTaskDO> selectPage(EmergencyTaskPageReqVO reqVO) { | |
| 25 | + LocalDateTime startDateTime = null; | |
| 26 | + LocalDateTime endDateTime = null; | |
| 27 | + if (reqVO.getStartTime() != null) { | |
| 28 | + startDateTime = reqVO.getStartTime().atStartOfDay(); | |
| 29 | + } | |
| 30 | + // 处理结束时间 (转为当天 23:59:59...) | |
| 31 | + if (reqVO.getEndTime() != null) { | |
| 32 | + endDateTime = reqVO.getEndTime().atTime(LocalTime.MAX); | |
| 33 | + } | |
| 34 | + return selectPage(reqVO, new LambdaQueryWrapperX<EmergencyTaskDO>() | |
| 35 | + .eqIfPresent(EmergencyTaskDO::getTaskNo, reqVO.getTaskNo()) | |
| 36 | + .eqIfPresent(EmergencyTaskDO::getEmergencyTypeId, reqVO.getEmergencyTypeId()) | |
| 37 | + .eqIfPresent(EmergencyTaskDO::getEmergencyHarmId, reqVO.getEmergencyHarmId()) | |
| 38 | + .eqIfPresent(EmergencyTaskDO::getTreeOwnershipId, reqVO.getTreeOwnershipId()) | |
| 39 | + .likeIfPresent(EmergencyTaskDO::getEmergencyLocation, reqVO.getEmergencyLocation()) | |
| 40 | + .eqIfPresent(EmergencyTaskDO::getBusiStatus, reqVO.getBusiStatus()) | |
| 41 | + .eqIfPresent(EmergencyTaskDO::getCompanyId, reqVO.getCompanyId()) | |
| 42 | + .betweenIfPresent(EmergencyTaskDO::getDiscoveryTime, startDateTime, endDateTime) | |
| 43 | + .orderByDesc(EmergencyTaskDO::getId)); | |
| 44 | + } | |
| 45 | + | |
| 46 | + int deleteByTaskNo(@Param("taskNo") String taskNo); | |
| 47 | + | |
| 48 | +} | |
| 0 | 49 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/enums/ErrorCodeConstants.java
| ... | ... | @@ -142,4 +142,7 @@ public interface ErrorCodeConstants { |
| 142 | 142 | ErrorCode UNIT_INTEGRAL_ADD_NOT_EXISTS = new ErrorCode(1-100-012-002, "积分增加记录不存在"); |
| 143 | 143 | |
| 144 | 144 | ErrorCode UNIT_INTEGRAL_SUB_NOT_EXISTS = new ErrorCode(1-100-012-003, "积分扣减记录不存在"); |
| 145 | + | |
| 146 | + ErrorCode EMERGENCY_TASK_NOT_EXISTS = new ErrorCode(1-100-006-002, "抢险任务主不存在"); | |
| 147 | + | |
| 145 | 148 | } | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/device/DeviceClockRecordServiceImpl.java
| ... | ... | @@ -68,7 +68,7 @@ public class DeviceClockRecordServiceImpl implements DeviceClockRecordService { |
| 68 | 68 | |
| 69 | 69 | private void validateDeviceClockRecordExists(Integer id) { |
| 70 | 70 | if (deviceClockRecordMapper.selectById(id) == null) { |
| 71 | - throw exception(DEVICE_CLOCK_RECORD_NOT_EXISTS); | |
| 71 | + // throw exception(DEVICE_CLOCK_RECORD_NOT_EXISTS); | |
| 72 | 72 | } |
| 73 | 73 | } |
| 74 | 74 | |
| ... | ... | @@ -82,4 +82,4 @@ public class DeviceClockRecordServiceImpl implements DeviceClockRecordService { |
| 82 | 82 | return deviceClockRecordMapper.selectPage(pageReqVO); |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | -} | |
| 86 | 85 | \ No newline at end of file |
| 86 | +} | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/emergencytask/EmergencyMachineryService.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.service.emergencytask; | |
| 2 | + | |
| 3 | +import java.util.*; | |
| 4 | +import jakarta.validation.*; | |
| 5 | +import com.zteits.urbanops.module.garden.controller.admin.emergencytask.vo.*; | |
| 6 | +import com.zteits.urbanops.module.garden.dal.dataobject.emergencytask.EmergencyMachineryDO; | |
| 7 | +import com.zteits.urbanops.framework.common.pojo.PageResult; | |
| 8 | +import com.zteits.urbanops.framework.common.pojo.PageParam; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * 抢险机械子 Service 接口 | |
| 12 | + * | |
| 13 | + * @author 超级管理员 | |
| 14 | + */ | |
| 15 | +public interface EmergencyMachineryService { | |
| 16 | + | |
| 17 | + /** | |
| 18 | + * 创建抢险机械子 | |
| 19 | + * | |
| 20 | + * @param createReqVO 创建信息 | |
| 21 | + * @return 编号 | |
| 22 | + */ | |
| 23 | + Long createEmergencyMachinery(@Valid EmergencyMachinerySaveReqVO createReqVO); | |
| 24 | + | |
| 25 | + /** | |
| 26 | + * 更新抢险机械子 | |
| 27 | + * | |
| 28 | + * @param updateReqVO 更新信息 | |
| 29 | + */ | |
| 30 | + void updateEmergencyMachinery(@Valid EmergencyMachinerySaveReqVO updateReqVO); | |
| 31 | + | |
| 32 | + /** | |
| 33 | + * 删除抢险机械子 | |
| 34 | + * | |
| 35 | + * @param id 编号 | |
| 36 | + */ | |
| 37 | + void deleteEmergencyMachinery(Long id); | |
| 38 | + | |
| 39 | + /** | |
| 40 | + * 批量删除抢险机械子 | |
| 41 | + * | |
| 42 | + * @param ids 编号 | |
| 43 | + */ | |
| 44 | + void deleteEmergencyMachineryListByIds(List<Long> ids); | |
| 45 | + | |
| 46 | + /** | |
| 47 | + * 获得抢险机械子 | |
| 48 | + * | |
| 49 | + * @param id 编号 | |
| 50 | + * @return 抢险机械子 | |
| 51 | + */ | |
| 52 | + EmergencyMachineryDO getEmergencyMachinery(Long id); | |
| 53 | + | |
| 54 | + /** | |
| 55 | + * 获得抢险机械子分页 | |
| 56 | + * | |
| 57 | + * @param pageReqVO 分页查询 | |
| 58 | + * @return 抢险机械子分页 | |
| 59 | + */ | |
| 60 | + PageResult<EmergencyMachineryDO> getEmergencyMachineryPage(EmergencyMachineryPageReqVO pageReqVO); | |
| 61 | + | |
| 62 | +} | |
| 0 | 63 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/emergencytask/EmergencyMachineryServiceImpl.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.service.emergencytask; | |
| 2 | + | |
| 3 | +import cn.hutool.core.collection.CollUtil; | |
| 4 | +import org.springframework.stereotype.Service; | |
| 5 | +import jakarta.annotation.Resource; | |
| 6 | +import org.springframework.validation.annotation.Validated; | |
| 7 | +import org.springframework.transaction.annotation.Transactional; | |
| 8 | + | |
| 9 | +import java.util.*; | |
| 10 | +import com.zteits.urbanops.module.garden.controller.admin.emergencytask.vo.*; | |
| 11 | +import com.zteits.urbanops.module.garden.dal.dataobject.emergencytask.EmergencyMachineryDO; | |
| 12 | +import com.zteits.urbanops.framework.common.pojo.PageResult; | |
| 13 | +import com.zteits.urbanops.framework.common.pojo.PageParam; | |
| 14 | +import com.zteits.urbanops.framework.common.util.object.BeanUtils; | |
| 15 | + | |
| 16 | +import com.zteits.urbanops.module.garden.dal.mysql.emergencytask.EmergencyMachineryMapper; | |
| 17 | + | |
| 18 | +import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; | |
| 19 | +import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.convertList; | |
| 20 | +import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.diffList; | |
| 21 | +import static com.zteits.urbanops.module.garden.enums.ErrorCodeConstants.*; | |
| 22 | + | |
| 23 | +/** | |
| 24 | + * 抢险机械子 Service 实现类 | |
| 25 | + * | |
| 26 | + * @author 超级管理员 | |
| 27 | + */ | |
| 28 | +@Service | |
| 29 | +@Validated | |
| 30 | +public class EmergencyMachineryServiceImpl implements EmergencyMachineryService { | |
| 31 | + | |
| 32 | + @Resource | |
| 33 | + private EmergencyMachineryMapper emergencyMachineryMapper; | |
| 34 | + | |
| 35 | + @Override | |
| 36 | + public Long createEmergencyMachinery(EmergencyMachinerySaveReqVO createReqVO) { | |
| 37 | + // 插入 | |
| 38 | + EmergencyMachineryDO emergencyMachinery = BeanUtils.toBean(createReqVO, EmergencyMachineryDO.class); | |
| 39 | + emergencyMachineryMapper.insert(emergencyMachinery); | |
| 40 | + | |
| 41 | + // 返回 | |
| 42 | + return emergencyMachinery.getId(); | |
| 43 | + } | |
| 44 | + | |
| 45 | + @Override | |
| 46 | + public void updateEmergencyMachinery(EmergencyMachinerySaveReqVO updateReqVO) { | |
| 47 | + // 校验存在 | |
| 48 | + // validateEmergencyMachineryExists(updateReqVO.getId()); | |
| 49 | + // 更新 | |
| 50 | + EmergencyMachineryDO updateObj = BeanUtils.toBean(updateReqVO, EmergencyMachineryDO.class); | |
| 51 | + emergencyMachineryMapper.updateById(updateObj); | |
| 52 | + } | |
| 53 | + | |
| 54 | + @Override | |
| 55 | + public void deleteEmergencyMachinery(Long id) { | |
| 56 | + // 校验存在 | |
| 57 | + validateEmergencyMachineryExists(id); | |
| 58 | + // 删除 | |
| 59 | + emergencyMachineryMapper.deleteById(id); | |
| 60 | + } | |
| 61 | + | |
| 62 | + @Override | |
| 63 | + public void deleteEmergencyMachineryListByIds(List<Long> ids) { | |
| 64 | + // 删除 | |
| 65 | + emergencyMachineryMapper.deleteByIds(ids); | |
| 66 | + } | |
| 67 | + | |
| 68 | + | |
| 69 | + private void validateEmergencyMachineryExists(Long id) { | |
| 70 | + if (emergencyMachineryMapper.selectById(id) == null) { | |
| 71 | + //throw exception(EMERGENCY_MACHINERY_NOT_EXISTS); | |
| 72 | + } | |
| 73 | + } | |
| 74 | + | |
| 75 | + @Override | |
| 76 | + public EmergencyMachineryDO getEmergencyMachinery(Long id) { | |
| 77 | + return emergencyMachineryMapper.selectById(id); | |
| 78 | + } | |
| 79 | + | |
| 80 | + @Override | |
| 81 | + public PageResult<EmergencyMachineryDO> getEmergencyMachineryPage(EmergencyMachineryPageReqVO pageReqVO) { | |
| 82 | + return emergencyMachineryMapper.selectPage(pageReqVO); | |
| 83 | + } | |
| 84 | + | |
| 85 | +} | |
| 0 | 86 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/emergencytask/EmergencyTaskService.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.service.emergencytask; | |
| 2 | + | |
| 3 | +import java.util.*; | |
| 4 | +import jakarta.validation.*; | |
| 5 | +import com.zteits.urbanops.module.garden.controller.admin.emergencytask.vo.*; | |
| 6 | +import com.zteits.urbanops.module.garden.dal.dataobject.emergencytask.EmergencyTaskDO; | |
| 7 | +import com.zteits.urbanops.framework.common.pojo.PageResult; | |
| 8 | +import com.zteits.urbanops.framework.common.pojo.PageParam; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * 抢险任务主 Service 接口 | |
| 12 | + * | |
| 13 | + * @author 超级管理员 | |
| 14 | + */ | |
| 15 | +public interface EmergencyTaskService { | |
| 16 | + | |
| 17 | + /** | |
| 18 | + * 创建抢险任务主 | |
| 19 | + * | |
| 20 | + * @param createReqVO 创建信息 | |
| 21 | + * @return 编号 | |
| 22 | + */ | |
| 23 | + Long createEmergencyTask(@Valid EmergencyTaskSaveReqVO createReqVO); | |
| 24 | + | |
| 25 | + /** | |
| 26 | + * 集团审批 | |
| 27 | + * @param createReqVO | |
| 28 | + * @return | |
| 29 | + */ | |
| 30 | + int approvalEmergencyTask(EmergencyTaskApprovalReqVO createReqVO); | |
| 31 | + | |
| 32 | + /** | |
| 33 | + * 更新抢险任务主 | |
| 34 | + * | |
| 35 | + * @param updateReqVO 更新信息 | |
| 36 | + */ | |
| 37 | + void updateEmergencyTask(@Valid EmergencyTaskSaveReqVO updateReqVO); | |
| 38 | + | |
| 39 | + /** | |
| 40 | + * 删除抢险任务主 | |
| 41 | + * | |
| 42 | + * @param id 编号 | |
| 43 | + */ | |
| 44 | + void deleteEmergencyTask(Long id); | |
| 45 | + | |
| 46 | + /** | |
| 47 | + * 删除抢险任务主 | |
| 48 | + * | |
| 49 | + * @param taskNO 编号 | |
| 50 | + */ | |
| 51 | + void deleteEmergencyTaskByTaskNo(String taskNO); | |
| 52 | + | |
| 53 | + /** | |
| 54 | + * 批量删除抢险任务主 | |
| 55 | + * | |
| 56 | + * @param ids 编号 | |
| 57 | + */ | |
| 58 | + void deleteEmergencyTaskListByIds(List<Long> ids); | |
| 59 | + | |
| 60 | + /** | |
| 61 | + * 获得抢险任务主 | |
| 62 | + * | |
| 63 | + * @param id 编号 | |
| 64 | + * @return 抢险任务主 | |
| 65 | + */ | |
| 66 | + EmergencyTaskDO getEmergencyTask(Long id); | |
| 67 | + | |
| 68 | + /** | |
| 69 | + * 获得抢险任务主 | |
| 70 | + * | |
| 71 | + * @param taskNo 编号 | |
| 72 | + * @return 抢险任务主 | |
| 73 | + */ | |
| 74 | + EmergencyTaskRespVO getEmergencyTaskByTaskNo(String taskNo); | |
| 75 | + | |
| 76 | + /** | |
| 77 | + * 获得抢险任务主分页 | |
| 78 | + * | |
| 79 | + * @param pageReqVO 分页查询 | |
| 80 | + * @return 抢险任务主分页 | |
| 81 | + */ | |
| 82 | + PageResult<EmergencyTaskRespVO> getEmergencyTaskPage(EmergencyTaskPageReqVO pageReqVO); | |
| 83 | + | |
| 84 | +} | |
| 0 | 85 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/emergencytask/EmergencyTaskServiceImpl.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.service.emergencytask; | |
| 2 | + | |
| 3 | +import cn.hutool.core.collection.CollUtil; | |
| 4 | +import cn.hutool.core.collection.CollectionUtil; | |
| 5 | +import cn.hutool.core.util.RandomUtil; | |
| 6 | +import com.alibaba.fastjson.JSON; | |
| 7 | +import com.alibaba.fastjson.JSONObject; | |
| 8 | +import com.baomidou.mybatisplus.core.conditions.Wrapper; | |
| 9 | +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; | |
| 10 | +import com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils; | |
| 11 | +import com.zteits.urbanops.module.garden.controller.admin.road.vo.RoadRespVO; | |
| 12 | +import com.zteits.urbanops.module.garden.dal.dataobject.emergencytask.EmergencyMachineryDO; | |
| 13 | +import com.zteits.urbanops.module.garden.dal.mysql.emergencytask.EmergencyMachineryMapper; | |
| 14 | +import com.zteits.urbanops.module.system.api.dept.DeptApi; | |
| 15 | +import com.zteits.urbanops.module.system.api.dept.dto.DeptRespDTO; | |
| 16 | +import jodd.util.StringUtil; | |
| 17 | +import org.apache.commons.lang3.StringUtils; | |
| 18 | +import org.springframework.stereotype.Service; | |
| 19 | +import jakarta.annotation.Resource; | |
| 20 | +import org.springframework.util.CollectionUtils; | |
| 21 | +import org.springframework.validation.annotation.Validated; | |
| 22 | +import org.springframework.transaction.annotation.Transactional; | |
| 23 | + | |
| 24 | +import java.util.*; | |
| 25 | +import java.util.stream.Collectors; | |
| 26 | + | |
| 27 | +import com.zteits.urbanops.module.garden.controller.admin.emergencytask.vo.*; | |
| 28 | +import com.zteits.urbanops.module.garden.dal.dataobject.emergencytask.EmergencyTaskDO; | |
| 29 | +import com.zteits.urbanops.framework.common.pojo.PageResult; | |
| 30 | +import com.zteits.urbanops.framework.common.pojo.PageParam; | |
| 31 | +import com.zteits.urbanops.framework.common.util.object.BeanUtils; | |
| 32 | + | |
| 33 | +import com.zteits.urbanops.module.garden.dal.mysql.emergencytask.EmergencyTaskMapper; | |
| 34 | + | |
| 35 | +import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; | |
| 36 | +import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.convertList; | |
| 37 | +import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.diffList; | |
| 38 | +import static com.zteits.urbanops.module.garden.enums.ErrorCodeConstants.*; | |
| 39 | + | |
| 40 | +/** | |
| 41 | + * 抢险任务主 Service 实现类 | |
| 42 | + * | |
| 43 | + * @author 超级管理员 | |
| 44 | + */ | |
| 45 | +@Service | |
| 46 | +@Validated | |
| 47 | +public class EmergencyTaskServiceImpl implements EmergencyTaskService { | |
| 48 | + | |
| 49 | + @Resource | |
| 50 | + private EmergencyTaskMapper emergencyTaskMapper; | |
| 51 | + | |
| 52 | + @Resource | |
| 53 | + private EmergencyMachineryMapper emergencyMachineryMapper; | |
| 54 | + | |
| 55 | + @Resource | |
| 56 | + protected DeptApi deptApi; | |
| 57 | + | |
| 58 | + @Transactional(rollbackFor = Exception.class) | |
| 59 | + @Override | |
| 60 | + public Long createEmergencyTask(EmergencyTaskSaveReqVO createReqVO) { | |
| 61 | + String userId = SecurityFrameworkUtils.getLoginUserId() + ""; | |
| 62 | + String userName = SecurityFrameworkUtils.getLoginUserNickname(); | |
| 63 | + String taskNo = createReqVO.getTaskNo(); | |
| 64 | + if(StringUtils.isEmpty(createReqVO.getTaskNo())){ | |
| 65 | + taskNo = "T" + System.currentTimeMillis() + RandomUtil.randomInt(1000, 9999); | |
| 66 | + } | |
| 67 | + Long companyId = SecurityFrameworkUtils.getCompanyId(); | |
| 68 | + Long deptId = SecurityFrameworkUtils.getDeptId(); | |
| 69 | + // 插入 | |
| 70 | + EmergencyTaskDO emergencyTask = new EmergencyTaskDO(); | |
| 71 | + emergencyTask.setTaskNo(taskNo); | |
| 72 | + emergencyTask.setDiscoveryTime(createReqVO.getDiscoveryTime()); | |
| 73 | + emergencyTask.setEmergencyTypeId(createReqVO.getEmergencyTypeId()); | |
| 74 | + emergencyTask.setEmergencyHarmId(createReqVO.getEmergencyHarmId()); | |
| 75 | + emergencyTask.setTreeOwnershipId(createReqVO.getTreeOwnershipId()); | |
| 76 | + emergencyTask.setEmergencyLocation(createReqVO.getEmergencyLocation()); | |
| 77 | + emergencyTask.setReporter(createReqVO.getReporter()); | |
| 78 | + emergencyTask.setContactPhone(createReqVO.getContactPhone()); | |
| 79 | + emergencyTask.setRescueStartTime(createReqVO.getRescueStartTime()); | |
| 80 | + emergencyTask.setEmergencyImg(createReqVO.getEmergencyImg()); | |
| 81 | + emergencyTask.setTreeSpec(createReqVO.getTreeSpec()); | |
| 82 | + emergencyTask.setTreeSpecies(createReqVO.getTreeSpecies()); | |
| 83 | + emergencyTask.setRescueCompleteTime(createReqVO.getRescueCompleteTime()); | |
| 84 | + emergencyTask.setPersonnelCount(createReqVO.getPersonnelCount()); | |
| 85 | + emergencyTask.setEmergencyEndImg(createReqVO.getEmergencyEndImg()); | |
| 86 | + emergencyTask.setRemarks(createReqVO.getRemarks()); | |
| 87 | + emergencyTask.setBusiStatus(createReqVO.getBusiStatus()); | |
| 88 | + emergencyTask.setStatus(createReqVO.getStatus()); | |
| 89 | + emergencyTask.setCompanyId(companyId); | |
| 90 | + emergencyTask.setDeptId(deptId); | |
| 91 | + emergencyTask.setCreator(userId); | |
| 92 | + emergencyTask.setCreatorName(userName); | |
| 93 | + emergencyTask.setUpdater(userId); | |
| 94 | + emergencyTask.setUpdaterName(userName); | |
| 95 | + emergencyTask.setApprovalRemarks(""); | |
| 96 | + emergencyTaskMapper.insert(emergencyTask); | |
| 97 | + | |
| 98 | + List<EmergencyMachineryDO> list = new ArrayList<>(); | |
| 99 | + String finalTaskNo = taskNo; | |
| 100 | + createReqVO.getEmergencyMachineryList().forEach(emergencyMachinery -> { | |
| 101 | + EmergencyMachineryDO emergencyMachineryDO = new EmergencyMachineryDO(); | |
| 102 | + emergencyMachineryDO.setTaskNo(finalTaskNo); | |
| 103 | + emergencyMachineryDO.setMachineryNameId(emergencyMachinery.getMachineryNameId()); | |
| 104 | + emergencyMachineryDO.setMachineryCount(emergencyMachinery.getMachineryCount()); | |
| 105 | + emergencyMachineryDO.setCreator(userId); | |
| 106 | + emergencyMachineryDO.setCreatorName(userName); | |
| 107 | + emergencyMachineryDO.setUpdater(userId); | |
| 108 | + emergencyMachineryDO.setUpdaterName(userName); | |
| 109 | + list.add(emergencyMachineryDO); | |
| 110 | + }); | |
| 111 | + | |
| 112 | + if(CollUtil.isNotEmpty(list)){ | |
| 113 | + emergencyMachineryMapper.insertBatch(list); | |
| 114 | + } | |
| 115 | + | |
| 116 | + | |
| 117 | + // 返回 | |
| 118 | + return emergencyTask.getId(); | |
| 119 | + } | |
| 120 | + | |
| 121 | + @Override | |
| 122 | + public int approvalEmergencyTask(EmergencyTaskApprovalReqVO createReqVO) { | |
| 123 | + String userId = SecurityFrameworkUtils.getLoginUserId() + ""; | |
| 124 | + String userName = SecurityFrameworkUtils.getLoginUserNickname(); | |
| 125 | + UpdateWrapper<EmergencyTaskDO> sqlWrapper = new UpdateWrapper<>(); | |
| 126 | + sqlWrapper.lambda().set(EmergencyTaskDO::getApprovalRemarks, createReqVO.getApprovalRemarks()) | |
| 127 | + .set(EmergencyTaskDO::getApprovalUserId, userId) | |
| 128 | + .set(EmergencyTaskDO::getApprovalUserName, userName) | |
| 129 | + .set(EmergencyTaskDO::getBusiStatus, createReqVO.getBusiStatus()) | |
| 130 | + .set(EmergencyTaskDO::getUpdateTime, new Date()) | |
| 131 | + .eq(EmergencyTaskDO::getTaskNo, createReqVO.getTaskNo()); | |
| 132 | + return emergencyTaskMapper.update(sqlWrapper); | |
| 133 | + } | |
| 134 | + | |
| 135 | + @Transactional(rollbackFor = Exception.class) | |
| 136 | + @Override | |
| 137 | + public void updateEmergencyTask(EmergencyTaskSaveReqVO updateReqVO) { | |
| 138 | + // 校验存在 | |
| 139 | + validateEmergencyTaskExists(updateReqVO.getTaskNo()); | |
| 140 | + this.deleteEmergencyTaskByTaskNo(updateReqVO.getTaskNo()); | |
| 141 | + this.createEmergencyTask(updateReqVO); | |
| 142 | + } | |
| 143 | + | |
| 144 | + @Override | |
| 145 | + public void deleteEmergencyTask(Long id) { | |
| 146 | + // 校验存在 | |
| 147 | + //validateEmergencyTaskExists(id); | |
| 148 | + // 删除 | |
| 149 | + emergencyTaskMapper.deleteById(id); | |
| 150 | + } | |
| 151 | + | |
| 152 | + @Transactional(rollbackFor = Exception.class) | |
| 153 | + @Override | |
| 154 | + public void deleteEmergencyTaskByTaskNo(String taskNO) { | |
| 155 | + emergencyTaskMapper.deleteByTaskNo(taskNO); | |
| 156 | + emergencyMachineryMapper.deleteByTaskNo(taskNO); | |
| 157 | + } | |
| 158 | + | |
| 159 | + @Override | |
| 160 | + public void deleteEmergencyTaskListByIds(List<Long> ids) { | |
| 161 | + // 删除 | |
| 162 | + emergencyTaskMapper.deleteByIds(ids); | |
| 163 | + } | |
| 164 | + | |
| 165 | + | |
| 166 | + private void validateEmergencyTaskExists(String taskNo) { | |
| 167 | + EmergencyTaskDO emergencyTaskDO = emergencyTaskMapper.selectOne(EmergencyTaskDO::getTaskNo, taskNo); | |
| 168 | + if(null == emergencyTaskDO){ | |
| 169 | + throw exception(EMERGENCY_TASK_NOT_EXISTS); | |
| 170 | + } | |
| 171 | + } | |
| 172 | + | |
| 173 | + @Override | |
| 174 | + public EmergencyTaskDO getEmergencyTask(Long id) { | |
| 175 | + return emergencyTaskMapper.selectById(id); | |
| 176 | + } | |
| 177 | + | |
| 178 | + @Override | |
| 179 | + public EmergencyTaskRespVO getEmergencyTaskByTaskNo(String taskNo) { | |
| 180 | + EmergencyTaskRespVO emergencyTaskRespVO = new EmergencyTaskRespVO(); | |
| 181 | + EmergencyTaskDO emergencyTaskDO = emergencyTaskMapper.selectOne(EmergencyTaskDO::getTaskNo, taskNo); | |
| 182 | + if(null != emergencyTaskDO){ | |
| 183 | + BeanUtils.copyProperties(emergencyTaskDO, emergencyTaskRespVO); | |
| 184 | + } | |
| 185 | + List<EmergencyMachineryDO> detailList = emergencyMachineryMapper.selectList(EmergencyMachineryDO::getTaskNo, emergencyTaskRespVO.getTaskNo()); | |
| 186 | + if(!CollectionUtil.isEmpty(detailList)){ | |
| 187 | + emergencyTaskRespVO.setEmergencyMachineryList(detailList); | |
| 188 | + } | |
| 189 | + return emergencyTaskRespVO; | |
| 190 | + } | |
| 191 | + | |
| 192 | + @Override | |
| 193 | + public PageResult<EmergencyTaskRespVO> getEmergencyTaskPage(EmergencyTaskPageReqVO pageReqVO) { | |
| 194 | + Long companyId = SecurityFrameworkUtils.getCompanyId(); | |
| 195 | + //超级管理员全返回 | |
| 196 | + if(companyId != null && !companyId.equals(100L)){ | |
| 197 | + pageReqVO.setCompanyId(companyId); | |
| 198 | + } | |
| 199 | + PageResult<EmergencyTaskDO> page = emergencyTaskMapper.selectPage(pageReqVO); | |
| 200 | + | |
| 201 | + List<EmergencyTaskDO> list = page.getList(); | |
| 202 | + List<EmergencyTaskRespVO> listTwo = BeanUtils.toBean(list, EmergencyTaskRespVO.class); | |
| 203 | + | |
| 204 | + listTwo.forEach(emergencyTaskRespVO -> { | |
| 205 | + List<EmergencyMachineryDO> detailList = emergencyMachineryMapper.selectList(EmergencyMachineryDO::getTaskNo, emergencyTaskRespVO.getTaskNo()); | |
| 206 | + if(!CollectionUtil.isEmpty(detailList)){ | |
| 207 | + emergencyTaskRespVO.setEmergencyMachineryList(detailList); | |
| 208 | + } | |
| 209 | + }); | |
| 210 | + addDataInspectionPlan(listTwo); | |
| 211 | + | |
| 212 | + // 转换返回 | |
| 213 | + return new PageResult<>(listTwo, page.getTotal()); | |
| 214 | + | |
| 215 | + } | |
| 216 | + | |
| 217 | + /** | |
| 218 | + * 回填部门/公司/角色 | |
| 219 | + * @param list 分页对象 | |
| 220 | + */ | |
| 221 | + private void addDataInspectionPlan(List<EmergencyTaskRespVO> list ){ | |
| 222 | + if(CollectionUtils.isEmpty(list)){ | |
| 223 | + return ; | |
| 224 | + } | |
| 225 | + //公司 | |
| 226 | + Set<Long> companyIds = list.stream().map(EmergencyTaskRespVO::getCompanyId).collect(Collectors.toSet()); | |
| 227 | + //部门 | |
| 228 | + Set<Long> deptIds = list.stream().map(EmergencyTaskRespVO::getDeptId).collect(Collectors.toSet()); | |
| 229 | + deptIds.addAll(companyIds); | |
| 230 | + /*1.获取部门*/ | |
| 231 | + Map<Long, DeptRespDTO> deptMap = deptApi.getDeptMap(deptIds); | |
| 232 | + | |
| 233 | + list.forEach(plan -> { | |
| 234 | + DeptRespDTO dept = deptMap.get(plan.getDeptId()); | |
| 235 | + if (dept != null) { | |
| 236 | + plan.setDeptName(dept.getName()); | |
| 237 | + | |
| 238 | + } | |
| 239 | + DeptRespDTO company = deptMap.get(plan.getCompanyId()); | |
| 240 | + if(company != null){ | |
| 241 | + plan.setCompanyName(company.getName()); | |
| 242 | + } | |
| 243 | + }); | |
| 244 | + } | |
| 245 | + | |
| 246 | + | |
| 247 | +} | |
| 0 | 248 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/resources/mapper/emergencytask/EmergencyMachineryMapper.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
| 3 | +<mapper namespace="com.zteits.urbanops.module.garden.dal.mysql.emergencytask.EmergencyMachineryMapper"> | |
| 4 | + | |
| 5 | + <!-- | |
| 6 | + 一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。 | |
| 7 | + 无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。 | |
| 8 | + 代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。 | |
| 9 | + 文档可见:https://www.iocoder.cn/MyBatis/x-plugins/ | |
| 10 | + --> | |
| 11 | + <delete id="deleteByTaskNo"> | |
| 12 | + DELETE FROM garden_emergency_machinery WHERE task_no = #{taskNo} | |
| 13 | + </delete> | |
| 14 | + | |
| 15 | +</mapper> | |
| 0 | 16 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/resources/mapper/emergencytask/EmergencyTaskMapper.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
| 3 | +<mapper namespace="com.zteits.urbanops.module.garden.dal.mysql.emergencytask.EmergencyTaskMapper"> | |
| 4 | + | |
| 5 | + <!-- | |
| 6 | + 一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。 | |
| 7 | + 无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。 | |
| 8 | + 代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。 | |
| 9 | + 文档可见:https://www.iocoder.cn/MyBatis/x-plugins/ | |
| 10 | + --> | |
| 11 | + | |
| 12 | + <delete id="deleteByTaskNo"> | |
| 13 | + DELETE FROM garden_emergency_task WHERE task_no = #{taskNo} | |
| 14 | + </delete> | |
| 15 | + | |
| 16 | +</mapper> | |
| 0 | 17 | \ No newline at end of file | ... | ... |
urbanops-module-system/src/main/java/com/zteits/urbanops/module/system/controller/admin/user/vo/user/UserImportExcelVO.java
urbanops-module-system/src/main/java/com/zteits/urbanops/module/system/framework/justauth/core/AuthRequestFactory.java
| ... | ... | @@ -63,7 +63,7 @@ public class AuthRequestFactory { |
| 63 | 63 | * |
| 64 | 64 | * @return Oauth列表 |
| 65 | 65 | */ |
| 66 | - @SuppressWarnings({"unchecked", "rawtypes"}) | |
| 66 | + @SuppressWarnings({ "unchecked", "rawtypes" }) | |
| 67 | 67 | public List<String> oauthList() { |
| 68 | 68 | // 默认列表 |
| 69 | 69 | List<String> defaultList = new ArrayList<>(properties.getType().keySet()); |
| ... | ... | @@ -100,9 +100,10 @@ public class AuthRequestFactory { |
| 100 | 100 | AuthRequest authRequest = getDefaultRequest(source); |
| 101 | 101 | |
| 102 | 102 | // 如果获取不到则尝试取自定义的 |
| 103 | -// if (authRequest == null) { | |
| 104 | -// authRequest = getExtendRequest(properties.getExtend().getEnumClass(), source); | |
| 105 | -// } | |
| 103 | + // if (authRequest == null) { | |
| 104 | + // authRequest = getExtendRequest(properties.getExtend().getEnumClass(), | |
| 105 | + // source); | |
| 106 | + // } | |
| 106 | 107 | |
| 107 | 108 | if (authRequest == null) { |
| 108 | 109 | throw new AuthException(AuthResponseStatus.UNSUPPORTED); |
| ... | ... | @@ -118,7 +119,7 @@ public class AuthRequestFactory { |
| 118 | 119 | * @param source {@link AuthSource} |
| 119 | 120 | * @return {@link AuthRequest} |
| 120 | 121 | */ |
| 121 | - @SuppressWarnings({"unchecked", "rawtypes"}) | |
| 122 | + @SuppressWarnings({ "unchecked", "rawtypes" }) | |
| 122 | 123 | private AuthRequest getExtendRequest(Class clazz, String source) { |
| 123 | 124 | String upperSource = source.toUpperCase(); |
| 124 | 125 | try { |
| ... | ... | @@ -151,7 +152,6 @@ public class AuthRequestFactory { |
| 151 | 152 | return null; |
| 152 | 153 | } |
| 153 | 154 | |
| 154 | - | |
| 155 | 155 | /** |
| 156 | 156 | * 获取默认的 Request |
| 157 | 157 | * |
| ... | ... | @@ -272,13 +272,13 @@ public class AuthRequestFactory { |
| 272 | 272 | case "OKTA": |
| 273 | 273 | return new AuthOktaRequest(config, authStateCache); |
| 274 | 274 | case "PROGINN": |
| 275 | - return new AuthProginnRequest(config,authStateCache); | |
| 275 | + return new AuthProginnRequest(config, authStateCache); | |
| 276 | 276 | case "AFDIAN": |
| 277 | - return new AuthAfDianRequest(config,authStateCache); | |
| 277 | + return new AuthAfDianRequest(config, authStateCache); | |
| 278 | 278 | case "APPLE": |
| 279 | - return new AuthAppleRequest(config,authStateCache); | |
| 279 | + return new AuthAppleRequest(config, authStateCache); | |
| 280 | 280 | case "FIGMA": |
| 281 | - return new AuthFigmaRequest(config,authStateCache); | |
| 281 | + return new AuthFigmaRequest(config, authStateCache); | |
| 282 | 282 | case "WECHAT_MINI_PROGRAM": |
| 283 | 283 | config.setIgnoreCheckRedirectUri(true); |
| 284 | 284 | config.setIgnoreCheckState(true); |
| ... | ... | @@ -300,23 +300,26 @@ public class AuthRequestFactory { |
| 300 | 300 | * @param authSource {@link AuthSource} |
| 301 | 301 | * @param authConfig {@link AuthConfig} |
| 302 | 302 | */ |
| 303 | - private void configureHttpConfig(String authSource, AuthConfig authConfig, JustAuthProperties.JustAuthHttpConfig httpConfig) { | |
| 303 | + private void configureHttpConfig(String authSource, AuthConfig authConfig, | |
| 304 | + JustAuthProperties.JustAuthHttpConfig httpConfig) { | |
| 304 | 305 | if (null == httpConfig) { |
| 305 | 306 | return; |
| 306 | 307 | } |
| 307 | - Map<String, JustAuthProperties.JustAuthProxyConfig> proxyConfigMap = httpConfig.getProxy(); | |
| 308 | - if (CollectionUtils.isEmpty(proxyConfigMap)) { | |
| 309 | - return; | |
| 310 | - } | |
| 311 | - JustAuthProperties.JustAuthProxyConfig proxyConfig = proxyConfigMap.get(authSource); | |
| 312 | 308 | |
| 313 | - if (null == proxyConfig) { | |
| 314 | - return; | |
| 309 | + // 构建 HttpConfig,优先设置 timeout(独立于 proxy 配置) | |
| 310 | + HttpConfig.HttpConfigBuilder builder = HttpConfig.builder() | |
| 311 | + .timeout(httpConfig.getTimeout()); | |
| 312 | + | |
| 313 | + // 如果有代理配置,则设置代理 | |
| 314 | + Map<String, JustAuthProperties.JustAuthProxyConfig> proxyConfigMap = httpConfig.getProxy(); | |
| 315 | + if (!CollectionUtils.isEmpty(proxyConfigMap)) { | |
| 316 | + JustAuthProperties.JustAuthProxyConfig proxyConfig = proxyConfigMap.get(authSource); | |
| 317 | + if (null != proxyConfig) { | |
| 318 | + builder.proxy(new Proxy(Proxy.Type.valueOf(proxyConfig.getType()), | |
| 319 | + new InetSocketAddress(proxyConfig.getHostname(), proxyConfig.getPort()))); | |
| 320 | + } | |
| 315 | 321 | } |
| 316 | 322 | |
| 317 | - authConfig.setHttpConfig(HttpConfig.builder() | |
| 318 | - .timeout(httpConfig.getTimeout()) | |
| 319 | - .proxy(new Proxy(Proxy.Type.valueOf(proxyConfig.getType()), new InetSocketAddress(proxyConfig.getHostname(), proxyConfig.getPort()))) | |
| 320 | - .build()); | |
| 323 | + authConfig.setHttpConfig(builder.build()); | |
| 321 | 324 | } |
| 322 | 325 | } | ... | ... |
urbanops-server/src/main/resources/application-dev.yaml
urbanops-server/src/main/resources/application-prod.yaml