Commit a096527a6f1f7d129a2589c8d971978cdddbe62f
1 parent
77cdab49
派单及人机材功能迁移
Showing
19 changed files
with
1142 additions
and
1 deletions
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/wasterecord/WasteRecordController.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.controller.admin.wasterecord; | |
| 2 | + | |
| 3 | +import org.springframework.web.bind.annotation.*; | |
| 4 | +import jakarta.annotation.Resource; | |
| 5 | +import org.springframework.validation.annotation.Validated; | |
| 6 | +import org.springframework.security.access.prepost.PreAuthorize; | |
| 7 | +import io.swagger.v3.oas.annotations.tags.Tag; | |
| 8 | +import io.swagger.v3.oas.annotations.Parameter; | |
| 9 | +import io.swagger.v3.oas.annotations.Operation; | |
| 10 | + | |
| 11 | +import jakarta.validation.constraints.*; | |
| 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 | +import com.zteits.urbanops.framework.common.util.object.BeanUtils; | |
| 21 | +import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; | |
| 22 | + | |
| 23 | +import com.zteits.urbanops.framework.excel.core.util.ExcelUtils; | |
| 24 | + | |
| 25 | +import com.zteits.urbanops.framework.apilog.core.annotation.ApiAccessLog; | |
| 26 | +import static com.zteits.urbanops.framework.apilog.core.enums.OperateTypeEnum.*; | |
| 27 | + | |
| 28 | +import com.zteits.urbanops.module.garden.controller.admin.wasterecord.vo.*; | |
| 29 | +import com.zteits.urbanops.module.garden.dal.dataobject.wasterecord.WasteRecordDO; | |
| 30 | +import com.zteits.urbanops.module.garden.service.wasterecord.WasteRecordService; | |
| 31 | + | |
| 32 | +@Tag(name = "管理后台 - 园林废弃物录入") | |
| 33 | +@RestController | |
| 34 | +@RequestMapping("/garden/waste-record") | |
| 35 | +@Validated | |
| 36 | +public class WasteRecordController { | |
| 37 | + | |
| 38 | + @Resource | |
| 39 | + private WasteRecordService wasteRecordService; | |
| 40 | + | |
| 41 | + @PostMapping("/create") | |
| 42 | + @Operation(summary = "创建园林废弃物录入") | |
| 43 | + @PreAuthorize("@ss.hasPermission('garden:waste-record:create')") | |
| 44 | + public CommonResult<Long> createWasteRecord(@Valid @RequestBody WasteRecordSaveReqVO createReqVO) { | |
| 45 | + return success(wasteRecordService.createWasteRecord(createReqVO)); | |
| 46 | + } | |
| 47 | + | |
| 48 | + @PutMapping("/update") | |
| 49 | + @Operation(summary = "更新园林废弃物录入") | |
| 50 | + @PreAuthorize("@ss.hasPermission('garden:waste-record:update')") | |
| 51 | + public CommonResult<Boolean> updateWasteRecord(@Valid @RequestBody WasteRecordSaveReqVO updateReqVO) { | |
| 52 | + wasteRecordService.updateWasteRecord(updateReqVO); | |
| 53 | + return success(true); | |
| 54 | + } | |
| 55 | + | |
| 56 | + @DeleteMapping("/delete") | |
| 57 | + @Operation(summary = "删除园林废弃物录入") | |
| 58 | + @Parameter(name = "id", description = "编号", required = true) | |
| 59 | + @PreAuthorize("@ss.hasPermission('garden:waste-record:delete')") | |
| 60 | + public CommonResult<Boolean> deleteWasteRecord(@RequestParam("id") Long id) { | |
| 61 | + wasteRecordService.deleteWasteRecord(id); | |
| 62 | + return success(true); | |
| 63 | + } | |
| 64 | + | |
| 65 | + @DeleteMapping("/delete-list") | |
| 66 | + @Parameter(name = "ids", description = "编号", required = true) | |
| 67 | + @Operation(summary = "批量删除园林废弃物录入") | |
| 68 | + @PreAuthorize("@ss.hasPermission('garden:waste-record:delete')") | |
| 69 | + public CommonResult<Boolean> deleteWasteRecordList(@RequestParam("ids") List<Long> ids) { | |
| 70 | + wasteRecordService.deleteWasteRecordListByIds(ids); | |
| 71 | + return success(true); | |
| 72 | + } | |
| 73 | + | |
| 74 | + @GetMapping("/get") | |
| 75 | + @Operation(summary = "获得园林废弃物录入") | |
| 76 | + @Parameter(name = "id", description = "编号", required = true, example = "1024") | |
| 77 | + @PreAuthorize("@ss.hasPermission('garden:waste-record:query')") | |
| 78 | + public CommonResult<WasteRecordRespVO> getWasteRecord(@RequestParam("id") Long id) { | |
| 79 | + WasteRecordDO wasteRecord = wasteRecordService.getWasteRecord(id); | |
| 80 | + return success(BeanUtils.toBean(wasteRecord, WasteRecordRespVO.class)); | |
| 81 | + } | |
| 82 | + | |
| 83 | + @GetMapping("/page") | |
| 84 | + @Operation(summary = "获得园林废弃物录入分页") | |
| 85 | + @PreAuthorize("@ss.hasPermission('garden:waste-record:query')") | |
| 86 | + public CommonResult<PageResult<WasteRecordRespVO>> getWasteRecordPage(@Valid WasteRecordPageReqVO pageReqVO) { | |
| 87 | + PageResult<WasteRecordDO> pageResult = wasteRecordService.getWasteRecordPage(pageReqVO); | |
| 88 | + return success(BeanUtils.toBean(pageResult, WasteRecordRespVO.class)); | |
| 89 | + } | |
| 90 | + | |
| 91 | + @GetMapping("/export-excel") | |
| 92 | + @Operation(summary = "导出园林废弃物录入 Excel") | |
| 93 | + @PreAuthorize("@ss.hasPermission('garden:waste-record:export')") | |
| 94 | + @ApiAccessLog(operateType = EXPORT) | |
| 95 | + public void exportWasteRecordExcel(@Valid WasteRecordPageReqVO pageReqVO, | |
| 96 | + HttpServletResponse response) throws IOException { | |
| 97 | + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); | |
| 98 | + List<WasteRecordDO> list = wasteRecordService.getWasteRecordPage(pageReqVO).getList(); | |
| 99 | + // 导出 Excel | |
| 100 | + ExcelUtils.write(response, "园林废弃物录入.xls", "数据", WasteRecordRespVO.class, | |
| 101 | + BeanUtils.toBean(list, WasteRecordRespVO.class)); | |
| 102 | + } | |
| 103 | + | |
| 104 | +} | |
| 0 | 105 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/wasterecord/vo/WasteRecordPageReqVO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.controller.admin.wasterecord.vo; | |
| 2 | + | |
| 3 | +import cn.idev.excel.annotation.ExcelProperty; | |
| 4 | +import com.zteits.urbanops.module.garden.dal.dataobject.teambizdomainrel.TeamBizdomainRelDO; | |
| 5 | +import lombok.*; | |
| 6 | + | |
| 7 | +import java.time.LocalDate; | |
| 8 | +import java.util.*; | |
| 9 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 10 | +import com.zteits.urbanops.framework.common.pojo.PageParam; | |
| 11 | +import java.math.BigDecimal; | |
| 12 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 13 | +import java.time.LocalDateTime; | |
| 14 | + | |
| 15 | +import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | |
| 16 | + | |
| 17 | +@Schema(description = "管理后台 - 园林废弃物录入分页 Request VO") | |
| 18 | +@Data | |
| 19 | +public class WasteRecordPageReqVO extends PageParam { | |
| 20 | + | |
| 21 | + @Schema(description = "运输日期") | |
| 22 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 23 | + private LocalDate[] transportDate; | |
| 24 | + | |
| 25 | + @Schema(description = "废弃物类型(如渣土、树枝等)", example = "1") | |
| 26 | + private String wasteType; | |
| 27 | + | |
| 28 | + @Schema(description = "运输车辆(如小型渣土车等)") | |
| 29 | + private String transportVehicle; | |
| 30 | + | |
| 31 | + @Schema(description = "车辆载重(吨)") | |
| 32 | + private BigDecimal vehicleLoad; | |
| 33 | + | |
| 34 | + @Schema(description = "运输次数") | |
| 35 | + private Integer transportTimes; | |
| 36 | + | |
| 37 | + @Schema(description = "单价", example = "19516") | |
| 38 | + private BigDecimal unitPrice; | |
| 39 | + | |
| 40 | + @Schema(description = "总费用(元)") | |
| 41 | + private BigDecimal totalCost; | |
| 42 | + | |
| 43 | + @Schema(description = "归属公司", example = "张三") | |
| 44 | + private String companyName; | |
| 45 | + | |
| 46 | + @Schema(description = "归属公司ID", example = "3314") | |
| 47 | + private String companyId; | |
| 48 | + | |
| 49 | + @Schema(description = "部门id", example = "26656") | |
| 50 | + private Long deptId; | |
| 51 | + | |
| 52 | + @Schema(description = "备注", example = "你说的对") | |
| 53 | + private String remark; | |
| 54 | + | |
| 55 | + @Schema(description = "创建时间") | |
| 56 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 57 | + private LocalDateTime[] createTime; | |
| 58 | + | |
| 59 | + @ExcelProperty("班组") | |
| 60 | + private List<TeamBizdomainRelDO> teamIds; | |
| 61 | + | |
| 62 | +} | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/wasterecord/vo/WasteRecordRespVO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.controller.admin.wasterecord.vo; | |
| 2 | + | |
| 3 | +import com.zteits.urbanops.module.garden.dal.dataobject.teambizdomainrel.TeamBizdomainRelDO; | |
| 4 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 5 | +import lombok.*; | |
| 6 | + | |
| 7 | +import java.time.LocalDate; | |
| 8 | +import java.util.*; | |
| 9 | +import java.math.BigDecimal; | |
| 10 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 11 | +import java.time.LocalDateTime; | |
| 12 | +import cn.idev.excel.annotation.*; | |
| 13 | + | |
| 14 | +@Schema(description = "管理后台 - 园林废弃物录入 Response VO") | |
| 15 | +@Data | |
| 16 | +@ExcelIgnoreUnannotated | |
| 17 | +public class WasteRecordRespVO { | |
| 18 | + | |
| 19 | + @Schema(description = "记录ID,自增主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "7310") | |
| 20 | + @ExcelProperty("记录ID,自增主键") | |
| 21 | + private Long id; | |
| 22 | + | |
| 23 | + @Schema(description = "运输日期", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 24 | + @ExcelProperty("运输日期") | |
| 25 | + private LocalDate transportDate; | |
| 26 | + | |
| 27 | + @Schema(description = "废弃物类型(如渣土、树枝等)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | |
| 28 | + @ExcelProperty("废弃物类型(如渣土、树枝等)") | |
| 29 | + private String wasteType; | |
| 30 | + | |
| 31 | + @Schema(description = "运输车辆(如小型渣土车等)", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 32 | + @ExcelProperty("运输车辆(如小型渣土车等)") | |
| 33 | + private String transportVehicle; | |
| 34 | + | |
| 35 | + @Schema(description = "车辆载重(吨)") | |
| 36 | + @ExcelProperty("车辆载重(吨)") | |
| 37 | + private BigDecimal vehicleLoad; | |
| 38 | + | |
| 39 | + @Schema(description = "运输次数") | |
| 40 | + @ExcelProperty("运输次数") | |
| 41 | + private Integer transportTimes; | |
| 42 | + | |
| 43 | + @Schema(description = "单价", example = "19516") | |
| 44 | + @ExcelProperty("单价") | |
| 45 | + private BigDecimal unitPrice; | |
| 46 | + | |
| 47 | + @Schema(description = "总费用(元)") | |
| 48 | + @ExcelProperty("总费用(元)") | |
| 49 | + private BigDecimal totalCost; | |
| 50 | + | |
| 51 | + @Schema(description = "归属公司", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") | |
| 52 | + @ExcelProperty("归属公司") | |
| 53 | + private String companyName; | |
| 54 | + | |
| 55 | + @Schema(description = "归属公司ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "3314") | |
| 56 | + @ExcelProperty("归属公司ID") | |
| 57 | + private String companyId; | |
| 58 | + | |
| 59 | + @Schema(description = "部门id", example = "26656") | |
| 60 | + @ExcelProperty("部门id") | |
| 61 | + private Long deptId; | |
| 62 | + | |
| 63 | + @Schema(description = "备注", example = "你说的对") | |
| 64 | + @ExcelProperty("备注") | |
| 65 | + private String remark; | |
| 66 | + | |
| 67 | + @Schema(description = "创建时间") | |
| 68 | + @ExcelProperty("创建时间") | |
| 69 | + private LocalDateTime createTime; | |
| 70 | + | |
| 71 | + @ExcelProperty("班组") | |
| 72 | + private List<TeamBizdomainRelDO> teamIds; | |
| 73 | + | |
| 74 | +} | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/wasterecord/vo/WasteRecordSaveReqVO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.controller.admin.wasterecord.vo; | |
| 2 | + | |
| 3 | +import cn.idev.excel.annotation.ExcelProperty; | |
| 4 | +import com.zteits.urbanops.module.garden.dal.dataobject.teambizdomainrel.TeamBizdomainRelDO; | |
| 5 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 6 | +import lombok.*; | |
| 7 | + | |
| 8 | +import java.time.LocalDate; | |
| 9 | +import java.util.*; | |
| 10 | +import jakarta.validation.constraints.*; | |
| 11 | +import java.math.BigDecimal; | |
| 12 | + | |
| 13 | +@Schema(description = "管理后台 - 园林废弃物录入新增/修改 Request VO") | |
| 14 | +@Data | |
| 15 | +public class WasteRecordSaveReqVO { | |
| 16 | + | |
| 17 | + @Schema(description = "记录ID,自增主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "7310") | |
| 18 | + private Long id; | |
| 19 | + | |
| 20 | + @Schema(description = "运输日期", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 21 | + @NotNull(message = "运输日期不能为空") | |
| 22 | + private LocalDate transportDate; | |
| 23 | + | |
| 24 | + @Schema(description = "废弃物类型(如渣土、树枝等)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | |
| 25 | + @NotEmpty(message = "废弃物类型(如渣土、树枝等)不能为空") | |
| 26 | + private String wasteType; | |
| 27 | + | |
| 28 | + @Schema(description = "运输车辆(如小型渣土车等)", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 29 | + @NotEmpty(message = "运输车辆(如小型渣土车等)不能为空") | |
| 30 | + private String transportVehicle; | |
| 31 | + | |
| 32 | + @Schema(description = "车辆载重(吨)") | |
| 33 | + private BigDecimal vehicleLoad; | |
| 34 | + | |
| 35 | + @Schema(description = "运输次数") | |
| 36 | + private Integer transportTimes; | |
| 37 | + | |
| 38 | + @Schema(description = "单价", example = "19516") | |
| 39 | + private BigDecimal unitPrice; | |
| 40 | + | |
| 41 | + @Schema(description = "总费用(元)") | |
| 42 | + private BigDecimal totalCost; | |
| 43 | + | |
| 44 | + @Schema(description = "归属公司", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") | |
| 45 | + @NotEmpty(message = "归属公司不能为空") | |
| 46 | + private String companyName; | |
| 47 | + | |
| 48 | + @Schema(description = "归属公司ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "3314") | |
| 49 | + @NotEmpty(message = "归属公司ID不能为空") | |
| 50 | + private String companyId; | |
| 51 | + | |
| 52 | + @Schema(description = "部门id", example = "26656") | |
| 53 | + private Long deptId; | |
| 54 | + | |
| 55 | + @Schema(description = "状态(0正常 1停用)", example = "1") | |
| 56 | + private Integer status; | |
| 57 | + | |
| 58 | + @Schema(description = "备注", example = "你说的对") | |
| 59 | + private String remark; | |
| 60 | + | |
| 61 | + @ExcelProperty("班组") | |
| 62 | + private List<TeamBizdomainRelDO> teamIds; | |
| 63 | +} | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/waterfee/WaterFeeController.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.controller.admin.waterfee; | |
| 2 | + | |
| 3 | +import org.springframework.web.bind.annotation.*; | |
| 4 | +import jakarta.annotation.Resource; | |
| 5 | +import org.springframework.validation.annotation.Validated; | |
| 6 | +import org.springframework.security.access.prepost.PreAuthorize; | |
| 7 | +import io.swagger.v3.oas.annotations.tags.Tag; | |
| 8 | +import io.swagger.v3.oas.annotations.Parameter; | |
| 9 | +import io.swagger.v3.oas.annotations.Operation; | |
| 10 | + | |
| 11 | +import jakarta.validation.constraints.*; | |
| 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 | +import com.zteits.urbanops.framework.common.util.object.BeanUtils; | |
| 21 | +import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; | |
| 22 | + | |
| 23 | +import com.zteits.urbanops.framework.excel.core.util.ExcelUtils; | |
| 24 | + | |
| 25 | +import com.zteits.urbanops.framework.apilog.core.annotation.ApiAccessLog; | |
| 26 | +import static com.zteits.urbanops.framework.apilog.core.enums.OperateTypeEnum.*; | |
| 27 | + | |
| 28 | +import com.zteits.urbanops.module.garden.controller.admin.waterfee.vo.*; | |
| 29 | +import com.zteits.urbanops.module.garden.dal.dataobject.waterfee.WaterFeeDO; | |
| 30 | +import com.zteits.urbanops.module.garden.service.waterfee.WaterFeeService; | |
| 31 | + | |
| 32 | +@Tag(name = "管理后台 - 水费录入信息") | |
| 33 | +@RestController | |
| 34 | +@RequestMapping("/garden/water-fee") | |
| 35 | +@Validated | |
| 36 | +public class WaterFeeController { | |
| 37 | + | |
| 38 | + @Resource | |
| 39 | + private WaterFeeService waterFeeService; | |
| 40 | + | |
| 41 | + @PostMapping("/create") | |
| 42 | + @Operation(summary = "创建水费录入信息") | |
| 43 | + @PreAuthorize("@ss.hasPermission('garden:water-fee:create')") | |
| 44 | + public CommonResult<Long> createWaterFee(@Valid @RequestBody WaterFeeSaveReqVO createReqVO) { | |
| 45 | + return success(waterFeeService.createWaterFee(createReqVO)); | |
| 46 | + } | |
| 47 | + | |
| 48 | + @PutMapping("/update") | |
| 49 | + @Operation(summary = "更新水费录入信息") | |
| 50 | + @PreAuthorize("@ss.hasPermission('garden:water-fee:update')") | |
| 51 | + public CommonResult<Boolean> updateWaterFee(@Valid @RequestBody WaterFeeSaveReqVO updateReqVO) { | |
| 52 | + waterFeeService.updateWaterFee(updateReqVO); | |
| 53 | + return success(true); | |
| 54 | + } | |
| 55 | + | |
| 56 | + @DeleteMapping("/delete") | |
| 57 | + @Operation(summary = "删除水费录入信息") | |
| 58 | + @Parameter(name = "id", description = "编号", required = true) | |
| 59 | + @PreAuthorize("@ss.hasPermission('garden:water-fee:delete')") | |
| 60 | + public CommonResult<Boolean> deleteWaterFee(@RequestParam("id") Long id) { | |
| 61 | + waterFeeService.deleteWaterFee(id); | |
| 62 | + return success(true); | |
| 63 | + } | |
| 64 | + | |
| 65 | + @DeleteMapping("/delete-list") | |
| 66 | + @Parameter(name = "ids", description = "编号", required = true) | |
| 67 | + @Operation(summary = "批量删除水费录入信息") | |
| 68 | + @PreAuthorize("@ss.hasPermission('garden:water-fee:delete')") | |
| 69 | + public CommonResult<Boolean> deleteWaterFeeList(@RequestParam("ids") List<Long> ids) { | |
| 70 | + waterFeeService.deleteWaterFeeListByIds(ids); | |
| 71 | + return success(true); | |
| 72 | + } | |
| 73 | + | |
| 74 | + @GetMapping("/get") | |
| 75 | + @Operation(summary = "获得水费录入信息") | |
| 76 | + @Parameter(name = "id", description = "编号", required = true, example = "1024") | |
| 77 | + @PreAuthorize("@ss.hasPermission('garden:water-fee:query')") | |
| 78 | + public CommonResult<WaterFeeRespVO> getWaterFee(@RequestParam("id") Long id) { | |
| 79 | + WaterFeeDO waterFee = waterFeeService.getWaterFee(id); | |
| 80 | + return success(BeanUtils.toBean(waterFee, WaterFeeRespVO.class)); | |
| 81 | + } | |
| 82 | + | |
| 83 | + @GetMapping("/page") | |
| 84 | + @Operation(summary = "获得水费录入信息分页") | |
| 85 | + @PreAuthorize("@ss.hasPermission('garden:water-fee:query')") | |
| 86 | + public CommonResult<PageResult<WaterFeeRespVO>> getWaterFeePage(@Valid WaterFeePageReqVO pageReqVO) { | |
| 87 | + PageResult<WaterFeeDO> pageResult = waterFeeService.getWaterFeePage(pageReqVO); | |
| 88 | + return success(BeanUtils.toBean(pageResult, WaterFeeRespVO.class)); | |
| 89 | + } | |
| 90 | + | |
| 91 | + @GetMapping("/export-excel") | |
| 92 | + @Operation(summary = "导出水费录入信息 Excel") | |
| 93 | + @PreAuthorize("@ss.hasPermission('garden:water-fee:export')") | |
| 94 | + @ApiAccessLog(operateType = EXPORT) | |
| 95 | + public void exportWaterFeeExcel(@Valid WaterFeePageReqVO pageReqVO, | |
| 96 | + HttpServletResponse response) throws IOException { | |
| 97 | + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); | |
| 98 | + List<WaterFeeDO> list = waterFeeService.getWaterFeePage(pageReqVO).getList(); | |
| 99 | + // 导出 Excel | |
| 100 | + ExcelUtils.write(response, "水费录入信息.xls", "数据", WaterFeeRespVO.class, | |
| 101 | + BeanUtils.toBean(list, WaterFeeRespVO.class)); | |
| 102 | + } | |
| 103 | + | |
| 104 | +} | |
| 0 | 105 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/waterfee/vo/WaterFeePageReqVO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.controller.admin.waterfee.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 java.math.BigDecimal; | |
| 8 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 9 | +import java.time.LocalDateTime; | |
| 10 | + | |
| 11 | +import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | |
| 12 | + | |
| 13 | +@Schema(description = "管理后台 - 水费录入信息分页 Request VO") | |
| 14 | +@Data | |
| 15 | +public class WaterFeePageReqVO extends PageParam { | |
| 16 | + | |
| 17 | + @Schema(description = "水费年月,如220505") | |
| 18 | + private String feeMonth; | |
| 19 | + | |
| 20 | + @Schema(description = "水表编码") | |
| 21 | + private String meterCode; | |
| 22 | + | |
| 23 | + @Schema(description = "水表地址") | |
| 24 | + private String meterAddress; | |
| 25 | + | |
| 26 | + @Schema(description = "水表门牌号码") | |
| 27 | + private String meterDoorplate; | |
| 28 | + | |
| 29 | + @Schema(description = "用水量(单位:立方米)") | |
| 30 | + private BigDecimal waterUsage; | |
| 31 | + | |
| 32 | + @Schema(description = "总水费(元)") | |
| 33 | + private BigDecimal totalFee; | |
| 34 | + | |
| 35 | + @Schema(description = "归属公司", example = "赵六") | |
| 36 | + private String companyName; | |
| 37 | + | |
| 38 | + @Schema(description = "部门id", example = "17710") | |
| 39 | + private Long deptId; | |
| 40 | + | |
| 41 | + @Schema(description = "归属公司ID", example = "15128") | |
| 42 | + private String companyId; | |
| 43 | + | |
| 44 | + @Schema(description = "创建时间") | |
| 45 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 46 | + private LocalDateTime[] createTime; | |
| 47 | + | |
| 48 | +} | |
| 0 | 49 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/waterfee/vo/WaterFeeRespVO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.controller.admin.waterfee.vo; | |
| 2 | + | |
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 4 | +import lombok.*; | |
| 5 | +import java.util.*; | |
| 6 | +import java.math.BigDecimal; | |
| 7 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 8 | +import java.time.LocalDateTime; | |
| 9 | +import cn.idev.excel.annotation.*; | |
| 10 | + | |
| 11 | +@Schema(description = "管理后台 - 水费录入信息 Response VO") | |
| 12 | +@Data | |
| 13 | +@ExcelIgnoreUnannotated | |
| 14 | +public class WaterFeeRespVO { | |
| 15 | + | |
| 16 | + @Schema(description = "记录ID,自增主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "24466") | |
| 17 | + @ExcelProperty("记录ID,自增主键") | |
| 18 | + private Long id; | |
| 19 | + | |
| 20 | + @Schema(description = "水费年月,如220505", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 21 | + @ExcelProperty("水费年月,如220505") | |
| 22 | + private String feeMonth; | |
| 23 | + | |
| 24 | + @Schema(description = "水表编码", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 25 | + @ExcelProperty("水表编码") | |
| 26 | + private String meterCode; | |
| 27 | + | |
| 28 | + @Schema(description = "水表地址") | |
| 29 | + @ExcelProperty("水表地址") | |
| 30 | + private String meterAddress; | |
| 31 | + | |
| 32 | + @Schema(description = "水表门牌号码") | |
| 33 | + @ExcelProperty("水表门牌号码") | |
| 34 | + private String meterDoorplate; | |
| 35 | + | |
| 36 | + @Schema(description = "用水量(单位:立方米)", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 37 | + @ExcelProperty("用水量(单位:立方米)") | |
| 38 | + private BigDecimal waterUsage; | |
| 39 | + | |
| 40 | + @Schema(description = "总水费(元)", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 41 | + @ExcelProperty("总水费(元)") | |
| 42 | + private BigDecimal totalFee; | |
| 43 | + | |
| 44 | + @Schema(description = "归属公司", example = "赵六") | |
| 45 | + @ExcelProperty("归属公司") | |
| 46 | + private String companyName; | |
| 47 | + | |
| 48 | + @Schema(description = "部门id", example = "17710") | |
| 49 | + @ExcelProperty("部门id") | |
| 50 | + private Long deptId; | |
| 51 | + | |
| 52 | + @Schema(description = "归属公司ID", example = "15128") | |
| 53 | + @ExcelProperty("归属公司ID") | |
| 54 | + private String companyId; | |
| 55 | + | |
| 56 | + @Schema(description = "创建时间") | |
| 57 | + @ExcelProperty("创建时间") | |
| 58 | + private LocalDateTime createTime; | |
| 59 | + | |
| 60 | +} | |
| 0 | 61 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/waterfee/vo/WaterFeeSaveReqVO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.controller.admin.waterfee.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 java.math.BigDecimal; | |
| 8 | + | |
| 9 | +@Schema(description = "管理后台 - 水费录入信息新增/修改 Request VO") | |
| 10 | +@Data | |
| 11 | +public class WaterFeeSaveReqVO { | |
| 12 | + | |
| 13 | + @Schema(description = "记录ID,自增主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "24466") | |
| 14 | + private Long id; | |
| 15 | + | |
| 16 | + @Schema(description = "水费年月,如220505", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 17 | + @NotEmpty(message = "水费年月,如220505不能为空") | |
| 18 | + private String feeMonth; | |
| 19 | + | |
| 20 | + @Schema(description = "水表编码", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 21 | + @NotEmpty(message = "水表编码不能为空") | |
| 22 | + private String meterCode; | |
| 23 | + | |
| 24 | + @Schema(description = "水表地址") | |
| 25 | + private String meterAddress; | |
| 26 | + | |
| 27 | + @Schema(description = "水表门牌号码") | |
| 28 | + private String meterDoorplate; | |
| 29 | + | |
| 30 | + @Schema(description = "用水量(单位:立方米)", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 31 | + @NotNull(message = "用水量(单位:立方米)不能为空") | |
| 32 | + private BigDecimal waterUsage; | |
| 33 | + | |
| 34 | + @Schema(description = "总水费(元)", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 35 | + @NotNull(message = "总水费(元)不能为空") | |
| 36 | + private BigDecimal totalFee; | |
| 37 | + | |
| 38 | + @Schema(description = "归属公司", example = "赵六") | |
| 39 | + private String companyName; | |
| 40 | + | |
| 41 | + @Schema(description = "部门id", example = "17710") | |
| 42 | + private Long deptId; | |
| 43 | + | |
| 44 | + @Schema(description = "归属公司ID", example = "15128") | |
| 45 | + private String companyId; | |
| 46 | + | |
| 47 | +} | |
| 0 | 48 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/wasterecord/WasteRecordDO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.dal.dataobject.wasterecord; | |
| 2 | + | |
| 3 | +import lombok.*; | |
| 4 | + | |
| 5 | +import java.time.LocalDate; | |
| 6 | +import java.util.*; | |
| 7 | +import java.math.BigDecimal; | |
| 8 | +import java.math.BigDecimal; | |
| 9 | +import java.math.BigDecimal; | |
| 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("garden_waste_record") | |
| 21 | +@KeySequence("garden_waste_record_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 WasteRecordDO extends BaseDO { | |
| 29 | + | |
| 30 | + /** | |
| 31 | + * 记录ID,自增主键 | |
| 32 | + */ | |
| 33 | + @TableId | |
| 34 | + private Long id; | |
| 35 | + /** | |
| 36 | + * 运输日期 | |
| 37 | + */ | |
| 38 | + private LocalDate transportDate; | |
| 39 | + /** | |
| 40 | + * 废弃物类型(如渣土、树枝等) | |
| 41 | + */ | |
| 42 | + private String wasteType; | |
| 43 | + /** | |
| 44 | + * 运输车辆(如小型渣土车等) | |
| 45 | + */ | |
| 46 | + private String transportVehicle; | |
| 47 | + /** | |
| 48 | + * 车辆载重(吨) | |
| 49 | + */ | |
| 50 | + private BigDecimal vehicleLoad; | |
| 51 | + /** | |
| 52 | + * 运输次数 | |
| 53 | + */ | |
| 54 | + private Integer transportTimes; | |
| 55 | + /** | |
| 56 | + * 单价 | |
| 57 | + */ | |
| 58 | + private BigDecimal unitPrice; | |
| 59 | + /** | |
| 60 | + * 总费用(元) | |
| 61 | + */ | |
| 62 | + private BigDecimal totalCost; | |
| 63 | + /** | |
| 64 | + * 归属公司 | |
| 65 | + */ | |
| 66 | + private String companyName; | |
| 67 | + /** | |
| 68 | + * 归属公司ID | |
| 69 | + */ | |
| 70 | + private String companyId; | |
| 71 | + /** | |
| 72 | + * 部门id | |
| 73 | + */ | |
| 74 | + private Long deptId; | |
| 75 | + /** | |
| 76 | + * 状态(0正常 1停用) | |
| 77 | + */ | |
| 78 | + private Integer status; | |
| 79 | + /** | |
| 80 | + * 备注 | |
| 81 | + */ | |
| 82 | + private String remark; | |
| 83 | + | |
| 84 | + | |
| 85 | +} | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/waterfee/WaterFeeDO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.dal.dataobject.waterfee; | |
| 2 | + | |
| 3 | +import lombok.*; | |
| 4 | +import java.util.*; | |
| 5 | +import java.math.BigDecimal; | |
| 6 | +import java.math.BigDecimal; | |
| 7 | +import java.time.LocalDateTime; | |
| 8 | +import java.time.LocalDateTime; | |
| 9 | +import com.baomidou.mybatisplus.annotation.*; | |
| 10 | +import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO; | |
| 11 | + | |
| 12 | +/** | |
| 13 | + * 水费录入信息 DO | |
| 14 | + * | |
| 15 | + * @author 超级管理员 | |
| 16 | + */ | |
| 17 | +@TableName("garden_water_fee") | |
| 18 | +@KeySequence("garden_water_fee_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 | |
| 19 | +@Data | |
| 20 | +@EqualsAndHashCode(callSuper = true) | |
| 21 | +@ToString(callSuper = true) | |
| 22 | +@Builder | |
| 23 | +@NoArgsConstructor | |
| 24 | +@AllArgsConstructor | |
| 25 | +public class WaterFeeDO extends BaseDO { | |
| 26 | + | |
| 27 | + /** | |
| 28 | + * 记录ID,自增主键 | |
| 29 | + */ | |
| 30 | + @TableId | |
| 31 | + private Long id; | |
| 32 | + /** | |
| 33 | + * 水费年月,如220505 | |
| 34 | + */ | |
| 35 | + private String feeMonth; | |
| 36 | + /** | |
| 37 | + * 水表编码 | |
| 38 | + */ | |
| 39 | + private String meterCode; | |
| 40 | + /** | |
| 41 | + * 水表地址 | |
| 42 | + */ | |
| 43 | + private String meterAddress; | |
| 44 | + /** | |
| 45 | + * 水表门牌号码 | |
| 46 | + */ | |
| 47 | + private String meterDoorplate; | |
| 48 | + /** | |
| 49 | + * 用水量(单位:立方米) | |
| 50 | + */ | |
| 51 | + private BigDecimal waterUsage; | |
| 52 | + /** | |
| 53 | + * 总水费(元) | |
| 54 | + */ | |
| 55 | + private BigDecimal totalFee; | |
| 56 | + /** | |
| 57 | + * 归属公司 | |
| 58 | + */ | |
| 59 | + private String companyName; | |
| 60 | + /** | |
| 61 | + * 部门id | |
| 62 | + */ | |
| 63 | + private Long deptId; | |
| 64 | + /** | |
| 65 | + * 归属公司ID | |
| 66 | + */ | |
| 67 | + private String companyId; | |
| 68 | + | |
| 69 | + | |
| 70 | +} | |
| 0 | 71 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/wasterecord/WasteRecordMapper.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.dal.mysql.wasterecord; | |
| 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.wasterecord.WasteRecordDO; | |
| 9 | +import org.apache.ibatis.annotations.Mapper; | |
| 10 | +import com.zteits.urbanops.module.garden.controller.admin.wasterecord.vo.*; | |
| 11 | + | |
| 12 | +/** | |
| 13 | + * 园林废弃物录入 Mapper | |
| 14 | + * | |
| 15 | + * @author 超级管理员 | |
| 16 | + */ | |
| 17 | +@Mapper | |
| 18 | +public interface WasteRecordMapper extends BaseMapperX<WasteRecordDO> { | |
| 19 | + | |
| 20 | + default PageResult<WasteRecordDO> selectPage(WasteRecordPageReqVO reqVO) { | |
| 21 | + return selectPage(reqVO, new LambdaQueryWrapperX<WasteRecordDO>() | |
| 22 | + .betweenIfPresent(WasteRecordDO::getTransportDate, reqVO.getTransportDate()) | |
| 23 | + .eqIfPresent(WasteRecordDO::getWasteType, reqVO.getWasteType()) | |
| 24 | + .eqIfPresent(WasteRecordDO::getTransportVehicle, reqVO.getTransportVehicle()) | |
| 25 | + .eqIfPresent(WasteRecordDO::getVehicleLoad, reqVO.getVehicleLoad()) | |
| 26 | + .eqIfPresent(WasteRecordDO::getTransportTimes, reqVO.getTransportTimes()) | |
| 27 | + .eqIfPresent(WasteRecordDO::getUnitPrice, reqVO.getUnitPrice()) | |
| 28 | + .eqIfPresent(WasteRecordDO::getTotalCost, reqVO.getTotalCost()) | |
| 29 | + .likeIfPresent(WasteRecordDO::getCompanyName, reqVO.getCompanyName()) | |
| 30 | + .eqIfPresent(WasteRecordDO::getCompanyId, reqVO.getCompanyId()) | |
| 31 | + .eqIfPresent(WasteRecordDO::getDeptId, reqVO.getDeptId()) | |
| 32 | + .eqIfPresent(WasteRecordDO::getRemark, reqVO.getRemark()) | |
| 33 | + .betweenIfPresent(WasteRecordDO::getCreateTime, reqVO.getCreateTime()) | |
| 34 | + .orderByDesc(WasteRecordDO::getId)); | |
| 35 | + } | |
| 36 | + | |
| 37 | +} | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/waterfee/WaterFeeMapper.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.dal.mysql.waterfee; | |
| 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.waterfee.WaterFeeDO; | |
| 9 | +import org.apache.ibatis.annotations.Mapper; | |
| 10 | +import com.zteits.urbanops.module.garden.controller.admin.waterfee.vo.*; | |
| 11 | + | |
| 12 | +/** | |
| 13 | + * 水费录入信息 Mapper | |
| 14 | + * | |
| 15 | + * @author 超级管理员 | |
| 16 | + */ | |
| 17 | +@Mapper | |
| 18 | +public interface WaterFeeMapper extends BaseMapperX<WaterFeeDO> { | |
| 19 | + | |
| 20 | + default PageResult<WaterFeeDO> selectPage(WaterFeePageReqVO reqVO) { | |
| 21 | + return selectPage(reqVO, new LambdaQueryWrapperX<WaterFeeDO>() | |
| 22 | + .eqIfPresent(WaterFeeDO::getFeeMonth, reqVO.getFeeMonth()) | |
| 23 | + .eqIfPresent(WaterFeeDO::getMeterCode, reqVO.getMeterCode()) | |
| 24 | + .eqIfPresent(WaterFeeDO::getMeterAddress, reqVO.getMeterAddress()) | |
| 25 | + .eqIfPresent(WaterFeeDO::getMeterDoorplate, reqVO.getMeterDoorplate()) | |
| 26 | + .eqIfPresent(WaterFeeDO::getWaterUsage, reqVO.getWaterUsage()) | |
| 27 | + .eqIfPresent(WaterFeeDO::getTotalFee, reqVO.getTotalFee()) | |
| 28 | + .likeIfPresent(WaterFeeDO::getCompanyName, reqVO.getCompanyName()) | |
| 29 | + .eqIfPresent(WaterFeeDO::getDeptId, reqVO.getDeptId()) | |
| 30 | + .eqIfPresent(WaterFeeDO::getCompanyId, reqVO.getCompanyId()) | |
| 31 | + .betweenIfPresent(WaterFeeDO::getCreateTime, reqVO.getCreateTime()) | |
| 32 | + .orderByDesc(WaterFeeDO::getId)); | |
| 33 | + } | |
| 34 | + | |
| 35 | +} | |
| 0 | 36 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/wasterecord/WasteRecordService.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.service.wasterecord; | |
| 2 | + | |
| 3 | +import java.util.*; | |
| 4 | +import jakarta.validation.*; | |
| 5 | +import com.zteits.urbanops.module.garden.controller.admin.wasterecord.vo.*; | |
| 6 | +import com.zteits.urbanops.module.garden.dal.dataobject.wasterecord.WasteRecordDO; | |
| 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 WasteRecordService { | |
| 16 | + | |
| 17 | + /** | |
| 18 | + * 创建园林废弃物录入 | |
| 19 | + * | |
| 20 | + * @param createReqVO 创建信息 | |
| 21 | + * @return 编号 | |
| 22 | + */ | |
| 23 | + Long createWasteRecord(@Valid WasteRecordSaveReqVO createReqVO); | |
| 24 | + | |
| 25 | + /** | |
| 26 | + * 更新园林废弃物录入 | |
| 27 | + * | |
| 28 | + * @param updateReqVO 更新信息 | |
| 29 | + */ | |
| 30 | + void updateWasteRecord(@Valid WasteRecordSaveReqVO updateReqVO); | |
| 31 | + | |
| 32 | + /** | |
| 33 | + * 删除园林废弃物录入 | |
| 34 | + * | |
| 35 | + * @param id 编号 | |
| 36 | + */ | |
| 37 | + void deleteWasteRecord(Long id); | |
| 38 | + | |
| 39 | + /** | |
| 40 | + * 批量删除园林废弃物录入 | |
| 41 | + * | |
| 42 | + * @param ids 编号 | |
| 43 | + */ | |
| 44 | + void deleteWasteRecordListByIds(List<Long> ids); | |
| 45 | + | |
| 46 | + /** | |
| 47 | + * 获得园林废弃物录入 | |
| 48 | + * | |
| 49 | + * @param id 编号 | |
| 50 | + * @return 园林废弃物录入 | |
| 51 | + */ | |
| 52 | + WasteRecordDO getWasteRecord(Long id); | |
| 53 | + | |
| 54 | + /** | |
| 55 | + * 获得园林废弃物录入分页 | |
| 56 | + * | |
| 57 | + * @param pageReqVO 分页查询 | |
| 58 | + * @return 园林废弃物录入分页 | |
| 59 | + */ | |
| 60 | + PageResult<WasteRecordDO> getWasteRecordPage(WasteRecordPageReqVO pageReqVO); | |
| 61 | + | |
| 62 | +} | |
| 0 | 63 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/wasterecord/WasteRecordServiceImpl.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.service.wasterecord; | |
| 2 | + | |
| 3 | +import cn.hutool.core.collection.CollUtil; | |
| 4 | +import com.zteits.urbanops.module.garden.enums.CostFeeConstants; | |
| 5 | +import com.zteits.urbanops.module.garden.service.teambizdomainrel.TeamBizdomainRelService; | |
| 6 | +import org.springframework.stereotype.Service; | |
| 7 | +import jakarta.annotation.Resource; | |
| 8 | +import org.springframework.validation.annotation.Validated; | |
| 9 | +import org.springframework.transaction.annotation.Transactional; | |
| 10 | + | |
| 11 | +import java.util.*; | |
| 12 | +import com.zteits.urbanops.module.garden.controller.admin.wasterecord.vo.*; | |
| 13 | +import com.zteits.urbanops.module.garden.dal.dataobject.wasterecord.WasteRecordDO; | |
| 14 | +import com.zteits.urbanops.framework.common.pojo.PageResult; | |
| 15 | +import com.zteits.urbanops.framework.common.pojo.PageParam; | |
| 16 | +import com.zteits.urbanops.framework.common.util.object.BeanUtils; | |
| 17 | + | |
| 18 | +import com.zteits.urbanops.module.garden.dal.mysql.wasterecord.WasteRecordMapper; | |
| 19 | + | |
| 20 | +import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; | |
| 21 | +import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.convertList; | |
| 22 | +import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.diffList; | |
| 23 | +import static com.zteits.urbanops.module.garden.enums.ErrorCodeConstants.*; | |
| 24 | + | |
| 25 | +/** | |
| 26 | + * 园林废弃物录入 Service 实现类 | |
| 27 | + * | |
| 28 | + * @author 超级管理员 | |
| 29 | + */ | |
| 30 | +@Service | |
| 31 | +@Validated | |
| 32 | +public class WasteRecordServiceImpl implements WasteRecordService { | |
| 33 | + | |
| 34 | + @Resource | |
| 35 | + private WasteRecordMapper wasteRecordMapper; | |
| 36 | + | |
| 37 | + @Resource | |
| 38 | + TeamBizdomainRelService teamBizdomainRelService; | |
| 39 | + @Override | |
| 40 | + @Transactional | |
| 41 | + public Long createWasteRecord(WasteRecordSaveReqVO createReqVO) { | |
| 42 | + // 插入 | |
| 43 | + WasteRecordDO wasteRecord = BeanUtils.toBean(createReqVO, WasteRecordDO.class); | |
| 44 | + wasteRecordMapper.insert(wasteRecord); | |
| 45 | + | |
| 46 | + | |
| 47 | + //add by wq 保存班组信息关联表 | |
| 48 | + teamBizdomainRelService.saveTeamBizdomainRel(createReqVO.getTeamIds(), wasteRecord.getId(), wasteRecord.getCompanyId(), wasteRecord.getCompanyName(), CostFeeConstants.COSTFEE_GARDENWASTE); | |
| 49 | + //add by wq 保存班组信息关联表 | |
| 50 | + // 返回 | |
| 51 | + return wasteRecord.getId(); | |
| 52 | + } | |
| 53 | + | |
| 54 | + @Override | |
| 55 | + @Transactional | |
| 56 | + public void updateWasteRecord(WasteRecordSaveReqVO updateReqVO) { | |
| 57 | + // 校验存在 | |
| 58 | + validateWasteRecordExists(updateReqVO.getId()); | |
| 59 | + // 更新 | |
| 60 | + WasteRecordDO updateObj = BeanUtils.toBean(updateReqVO, WasteRecordDO.class); | |
| 61 | + wasteRecordMapper.updateById(updateObj); | |
| 62 | + //add by wq 保存班组信息关联表 | |
| 63 | + teamBizdomainRelService.deleteTeamBizdomainRel(updateObj.getId(), CostFeeConstants.COSTFEE_GARDENWASTE); | |
| 64 | + teamBizdomainRelService.saveTeamBizdomainRel(updateReqVO.getTeamIds(), updateObj.getId(), updateObj.getCompanyId(), updateObj.getCompanyName(), CostFeeConstants.COSTFEE_GARDENWASTE); | |
| 65 | + //add by wq 保存班组信息关联表 | |
| 66 | + } | |
| 67 | + | |
| 68 | + @Override | |
| 69 | + public void deleteWasteRecord(Long id) { | |
| 70 | + // 校验存在 | |
| 71 | + validateWasteRecordExists(id); | |
| 72 | + // 删除 | |
| 73 | + wasteRecordMapper.deleteById(id); | |
| 74 | + | |
| 75 | + // add by wq 删除 | |
| 76 | + teamBizdomainRelService.deleteTeamBizdomainRel(id, CostFeeConstants.COSTFEE_GARDENWASTE); | |
| 77 | + // add by wq 删除 | |
| 78 | + } | |
| 79 | + | |
| 80 | + @Override | |
| 81 | + public void deleteWasteRecordListByIds(List<Long> ids) { | |
| 82 | + // 删除 | |
| 83 | + wasteRecordMapper.deleteByIds(ids); | |
| 84 | + // add by wq 删除 | |
| 85 | + if(ids.size() > 0) { | |
| 86 | + for (Long id : ids) { | |
| 87 | + teamBizdomainRelService.deleteTeamBizdomainRel(id, CostFeeConstants.COSTFEE_GARDENWASTE); | |
| 88 | + } | |
| 89 | + } | |
| 90 | + // add by wq 删除 | |
| 91 | + } | |
| 92 | + | |
| 93 | + | |
| 94 | + private void validateWasteRecordExists(Long id) { | |
| 95 | + if (wasteRecordMapper.selectById(id) == null) { | |
| 96 | + throw exception(WASTE_RECORD_NOT_EXISTS); | |
| 97 | + } | |
| 98 | + } | |
| 99 | + | |
| 100 | + @Override | |
| 101 | + public WasteRecordDO getWasteRecord(Long id) { | |
| 102 | + return wasteRecordMapper.selectById(id); | |
| 103 | + } | |
| 104 | + | |
| 105 | + @Override | |
| 106 | + public PageResult<WasteRecordDO> getWasteRecordPage(WasteRecordPageReqVO pageReqVO) { | |
| 107 | + return wasteRecordMapper.selectPage(pageReqVO); | |
| 108 | + } | |
| 109 | + | |
| 110 | +} | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/waterfee/WaterFeeService.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.service.waterfee; | |
| 2 | + | |
| 3 | +import java.util.*; | |
| 4 | +import jakarta.validation.*; | |
| 5 | +import com.zteits.urbanops.module.garden.controller.admin.waterfee.vo.*; | |
| 6 | +import com.zteits.urbanops.module.garden.dal.dataobject.waterfee.WaterFeeDO; | |
| 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 WaterFeeService { | |
| 16 | + | |
| 17 | + /** | |
| 18 | + * 创建水费录入信息 | |
| 19 | + * | |
| 20 | + * @param createReqVO 创建信息 | |
| 21 | + * @return 编号 | |
| 22 | + */ | |
| 23 | + Long createWaterFee(@Valid WaterFeeSaveReqVO createReqVO); | |
| 24 | + | |
| 25 | + /** | |
| 26 | + * 更新水费录入信息 | |
| 27 | + * | |
| 28 | + * @param updateReqVO 更新信息 | |
| 29 | + */ | |
| 30 | + void updateWaterFee(@Valid WaterFeeSaveReqVO updateReqVO); | |
| 31 | + | |
| 32 | + /** | |
| 33 | + * 删除水费录入信息 | |
| 34 | + * | |
| 35 | + * @param id 编号 | |
| 36 | + */ | |
| 37 | + void deleteWaterFee(Long id); | |
| 38 | + | |
| 39 | + /** | |
| 40 | + * 批量删除水费录入信息 | |
| 41 | + * | |
| 42 | + * @param ids 编号 | |
| 43 | + */ | |
| 44 | + void deleteWaterFeeListByIds(List<Long> ids); | |
| 45 | + | |
| 46 | + /** | |
| 47 | + * 获得水费录入信息 | |
| 48 | + * | |
| 49 | + * @param id 编号 | |
| 50 | + * @return 水费录入信息 | |
| 51 | + */ | |
| 52 | + WaterFeeDO getWaterFee(Long id); | |
| 53 | + | |
| 54 | + /** | |
| 55 | + * 获得水费录入信息分页 | |
| 56 | + * | |
| 57 | + * @param pageReqVO 分页查询 | |
| 58 | + * @return 水费录入信息分页 | |
| 59 | + */ | |
| 60 | + PageResult<WaterFeeDO> getWaterFeePage(WaterFeePageReqVO pageReqVO); | |
| 61 | + | |
| 62 | +} | |
| 0 | 63 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/waterfee/WaterFeeServiceImpl.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.service.waterfee; | |
| 2 | + | |
| 3 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
| 4 | +import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |
| 5 | +import com.zteits.urbanops.framework.common.pojo.PageResult; | |
| 6 | +import com.zteits.urbanops.framework.common.util.object.BeanUtils; | |
| 7 | +import com.zteits.urbanops.module.garden.controller.admin.waterfee.vo.WaterFeePageReqVO; | |
| 8 | +import com.zteits.urbanops.module.garden.controller.admin.waterfee.vo.WaterFeeSaveReqVO; | |
| 9 | +import com.zteits.urbanops.module.garden.dal.dataobject.waterfee.WaterFeeDO; | |
| 10 | +import com.zteits.urbanops.module.garden.dal.mysql.waterfee.WaterFeeMapper; | |
| 11 | +import jakarta.annotation.Resource; | |
| 12 | +import org.springframework.stereotype.Service; | |
| 13 | +import org.springframework.util.CollectionUtils; | |
| 14 | +import org.springframework.validation.annotation.Validated; | |
| 15 | + | |
| 16 | +import java.util.List; | |
| 17 | +import java.util.stream.Collectors; | |
| 18 | + | |
| 19 | +import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; | |
| 20 | +import static com.zteits.urbanops.module.garden.enums.ErrorCodeConstants.WATER_FEE_NOT_EXISTS; | |
| 21 | + | |
| 22 | +/** | |
| 23 | + * 水费录入信息 Service 实现类 | |
| 24 | + * | |
| 25 | + * @author 超级管理员 | |
| 26 | + */ | |
| 27 | +@Service | |
| 28 | +@Validated | |
| 29 | +public class WaterFeeServiceImpl implements WaterFeeService { | |
| 30 | + | |
| 31 | + @Resource | |
| 32 | + private WaterFeeMapper waterFeeMapper; | |
| 33 | + | |
| 34 | + @Override | |
| 35 | + public Long createWaterFee(WaterFeeSaveReqVO createReqVO) { | |
| 36 | + // add by wq 删除重复,录入最新记录 | |
| 37 | + LambdaQueryWrapper<WaterFeeDO> queryWrapper = Wrappers.lambdaQuery(); | |
| 38 | + queryWrapper.eq(WaterFeeDO::getFeeMonth, createReqVO.getFeeMonth()); | |
| 39 | + queryWrapper.eq(WaterFeeDO::getMeterCode, createReqVO.getMeterCode()); | |
| 40 | + List<WaterFeeDO> list = waterFeeMapper.selectList(queryWrapper); | |
| 41 | + if(!CollectionUtils.isEmpty(list)) { | |
| 42 | + List<Long> ids = list.stream().map(WaterFeeDO::getId).collect(Collectors.toList()); | |
| 43 | + waterFeeMapper.deleteByIds(ids); | |
| 44 | + } | |
| 45 | + // add by wq 删除重复,录入最新记录 | |
| 46 | + // 插入 | |
| 47 | + WaterFeeDO waterFee = BeanUtils.toBean(createReqVO, WaterFeeDO.class); | |
| 48 | + waterFeeMapper.insert(waterFee); | |
| 49 | + | |
| 50 | + // 返回 | |
| 51 | + return waterFee.getId(); | |
| 52 | + } | |
| 53 | + | |
| 54 | + @Override | |
| 55 | + public void updateWaterFee(WaterFeeSaveReqVO updateReqVO) { | |
| 56 | + // 校验存在 | |
| 57 | + validateWaterFeeExists(updateReqVO.getId()); | |
| 58 | + // 更新 | |
| 59 | + WaterFeeDO updateObj = BeanUtils.toBean(updateReqVO, WaterFeeDO.class); | |
| 60 | + waterFeeMapper.updateById(updateObj); | |
| 61 | + } | |
| 62 | + | |
| 63 | + @Override | |
| 64 | + public void deleteWaterFee(Long id) { | |
| 65 | + // 校验存在 | |
| 66 | + validateWaterFeeExists(id); | |
| 67 | + // 删除 | |
| 68 | + waterFeeMapper.deleteById(id); | |
| 69 | + } | |
| 70 | + | |
| 71 | + @Override | |
| 72 | + public void deleteWaterFeeListByIds(List<Long> ids) { | |
| 73 | + // 删除 | |
| 74 | + waterFeeMapper.deleteByIds(ids); | |
| 75 | + } | |
| 76 | + | |
| 77 | + | |
| 78 | + private void validateWaterFeeExists(Long id) { | |
| 79 | + if (waterFeeMapper.selectById(id) == null) { | |
| 80 | + throw exception(WATER_FEE_NOT_EXISTS); | |
| 81 | + } | |
| 82 | + } | |
| 83 | + | |
| 84 | + @Override | |
| 85 | + public WaterFeeDO getWaterFee(Long id) { | |
| 86 | + return waterFeeMapper.selectById(id); | |
| 87 | + } | |
| 88 | + | |
| 89 | + @Override | |
| 90 | + public PageResult<WaterFeeDO> getWaterFeePage(WaterFeePageReqVO pageReqVO) { | |
| 91 | + return waterFeeMapper.selectPage(pageReqVO); | |
| 92 | + } | |
| 93 | + | |
| 94 | +} | ... | ... |
urbanops-module-garden/src/main/resources/mapper/wasterecord/WasteRecordMapper.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.wasterecord.WasteRecordMapper"> | |
| 4 | + | |
| 5 | + <!-- | |
| 6 | + 一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。 | |
| 7 | + 无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。 | |
| 8 | + 代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。 | |
| 9 | + 文档可见:https://www.iocoder.cn/MyBatis/x-plugins/ | |
| 10 | + --> | |
| 11 | + | |
| 12 | +</mapper> | |
| 0 | 13 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/resources/mapper/waterfee/WaterFeeMapper.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.waterfee.WaterFeeMapper"> | |
| 4 | + | |
| 5 | + <!-- | |
| 6 | + 一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。 | |
| 7 | + 无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。 | |
| 8 | + 代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。 | |
| 9 | + 文档可见:https://www.iocoder.cn/MyBatis/x-plugins/ | |
| 10 | + --> | |
| 11 | + | |
| 12 | +</mapper> | |
| 0 | 13 | \ No newline at end of file | ... | ... |
urbanops-server/src/main/resources/logback-spring.xml
| ... | ... | @@ -48,7 +48,7 @@ |
| 48 | 48 | <root level="INFO"> |
| 49 | 49 | <appender-ref ref="STDOUT"/> |
| 50 | 50 | <!-- 本地环境下,如果不想【FILE】打印日志,可以注释掉本行 --> |
| 51 | - <appender-ref ref="ASYNC"/> | |
| 51 | + <!--<appender-ref ref="ASYNC"/>--> | |
| 52 | 52 | <!-- 如果想接入【SkyWalking 日志服务】,可以取消注释掉本行 --> |
| 53 | 53 | <!-- <appender-ref ref="SKYWALKING"/> --> |
| 54 | 54 | </root> | ... | ... |