diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/hotline/HotlineCaseAdminController.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/hotline/HotlineCaseAdminController.java deleted file mode 100644 index 5a55d89..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/hotline/HotlineCaseAdminController.java +++ /dev/null @@ -1,86 +0,0 @@ -package com.zteits.urbanops.module.garden.controller.admin.hotline; - -import com.zteits.urbanops.framework.common.pojo.CommonResult; -import com.zteits.urbanops.framework.common.pojo.PageParam; -import com.zteits.urbanops.framework.common.pojo.PageResult; -import com.zteits.urbanops.framework.excel.core.util.ExcelUtils; -import com.zteits.urbanops.module.garden.dal.dataobject.hotline.HotlineCaseDO; -import com.zteits.urbanops.module.garden.service.hotline.HotlineCaseService; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import jakarta.annotation.Resource; -import jakarta.servlet.http.HttpServletResponse; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import java.io.IOException; -import java.util.List; - -import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; -import static com.zteits.urbanops.framework.apilog.core.enums.OperateTypeEnum.EXPORT; -import com.zteits.urbanops.framework.apilog.core.annotation.ApiAccessLog; - -@Tag(name = "管理后台 - 12345案件信息") -@RestController -@RequestMapping("/business/hotlinecase") -public class HotlineCaseAdminController { - - @Resource - private HotlineCaseService service; - - @GetMapping("/list") - @Operation(summary = "查询列表") - @PreAuthorize("@ss.hasPermission('business:hotlinecase:list')") - public CommonResult> list(HotlineCaseDO where, - @RequestParam(value = "pageNum", required = false) Integer pageNum, - @RequestParam(value = "pageSize", required = false) Integer pageSize) { - PageParam page = new PageParam(); - page.setPageNo(pageNum == null ? 1 : pageNum); - page.setPageSize(pageSize == null ? 10 : pageSize); - return success(service.selectPage(page, where)); - } - - @PostMapping("export") - @Operation(summary = "导出列表") - @PreAuthorize("@ss.hasPermission('business:hotlinecase:export')") - @ApiAccessLog(operateType = EXPORT) - public void export(HotlineCaseDO where, HttpServletResponse response) throws IOException { - List list = service.selectPage(new PageParam(), where).getList(); - ExcelUtils.write(response, "12345案件信息.xls", "数据", HotlineCaseDO.class, list); - } - - @GetMapping("/{id}") - @Operation(summary = "详情") - @PreAuthorize("@ss.hasPermission('business:hotlinecase:query')") - public CommonResult getInfo(@PathVariable("id") String id) { - return success(service.selectById(id)); - } - - @GetMapping("/getInfoMore/{id}") - @Operation(summary = "详情(含附件与照片)") - @PreAuthorize("@ss.hasPermission('business:hotlinecase:query')") - public CommonResult getInfoMore(@PathVariable("id") String id) { - return success(service.getDetail(id)); - } - - @PostMapping - @Operation(summary = "新增") - @PreAuthorize("@ss.hasPermission('business:hotlinecase:add')") - public CommonResult add(@RequestBody HotlineCaseDO entity) { - return success(service.insert(entity)); - } - - @PutMapping - @Operation(summary = "修改") - @PreAuthorize("@ss.hasPermission('business:hotlinecase:edit')") - public CommonResult edit(@RequestBody HotlineCaseDO entity) { - return success(service.update(entity)); - } - - @DeleteMapping("/{ids}") - @Operation(summary = "删除") - @PreAuthorize("@ss.hasPermission('business:hotlinecase:remove')") - public CommonResult remove(@PathVariable List ids) { - return success(service.deleteByIds(ids)); - } -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/hotline/HotlineCaseController.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/hotline/HotlineCaseController.java deleted file mode 100644 index 3e4f025..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/hotline/HotlineCaseController.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.zteits.urbanops.module.garden.controller.admin.hotline; - -import com.zteits.urbanops.framework.common.pojo.CommonResult; -import com.zteits.urbanops.framework.common.pojo.PageParam; -import com.zteits.urbanops.framework.common.pojo.PageResult; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import java.util.Collections; -import java.util.List; -import java.util.Map; - -import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; - -@Tag(name = "管理后台 - 热线工单") -@RestController -@RequestMapping("/business/hotlinecase-compat") -public class HotlineCaseController { - - @GetMapping("/list") - @Operation(summary = "热线工单-列表") - public CommonResult>> list(@RequestParam(value = "page", required = false) Integer page, - @RequestParam(value = "pageSize", required = false) Integer pageSize) { - List> records = Collections.emptyList(); - long total = 0L; - return success(new PageResult<>(records, total)); - } -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/hotline/HotlineFileController.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/hotline/HotlineFileController.java deleted file mode 100644 index 414a91b..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/hotline/HotlineFileController.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.zteits.urbanops.module.garden.controller.admin.hotline; - -import com.zteits.urbanops.framework.common.pojo.CommonResult; -import com.zteits.urbanops.framework.excel.core.util.ExcelUtils; -import com.zteits.urbanops.module.garden.dal.dataobject.hotline.HotlineFileDO; -import com.zteits.urbanops.module.garden.service.hotline.HotlineFileService; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import jakarta.annotation.Resource; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; - -import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; - -@Tag(name = "管理后台 - 12345案件-文件") -@RestController -@RequestMapping("/business/file") -public class HotlineFileController { - - @Resource - private HotlineFileService hotlineFileService; - - @PostMapping("/parseFile") - @Operation(summary = "解析word文档") - public CommonResult parseFile(@RequestParam("file") MultipartFile file) throws Exception { - return success(hotlineFileService.parseFile(file)); - } - - @GetMapping("/list") - @Operation(summary = "文件-列表") - public CommonResult> list(HotlineFileDO where) { - return success(hotlineFileService.selectList(where)); - } - - @GetMapping("/export") - @Operation(summary = "文件-导出") - public void export(HotlineFileDO where, jakarta.servlet.http.HttpServletResponse response) throws IOException { - List list = hotlineFileService.selectList(where); - ExcelUtils.write(response, "file.xls", "数据", HotlineFileDO.class, list); - } - - @GetMapping("/{caseid}") - @Operation(summary = "文件-详情") - public CommonResult getInfo(@PathVariable("caseid") String caseid) { - return success(hotlineFileService.selectById(caseid)); - } - - @PostMapping - @Operation(summary = "文件-新增") - public CommonResult add(@RequestBody HotlineFileDO entity) { - return success(hotlineFileService.insert(entity)); - } - - @PutMapping - @Operation(summary = "文件-修改") - public CommonResult edit(@RequestBody HotlineFileDO entity) { - return success(hotlineFileService.update(entity)); - } - - @DeleteMapping("/{caseids}") - @Operation(summary = "文件-删除") - public CommonResult remove(@PathVariable String[] caseids) { - return success(hotlineFileService.deleteByIds(Arrays.asList(caseids))); - } -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/hotline/vo/HotlineCaseDetailResp.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/hotline/vo/HotlineCaseDetailResp.java deleted file mode 100644 index e52e6cc..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/hotline/vo/HotlineCaseDetailResp.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.zteits.urbanops.module.garden.controller.admin.hotline.vo; - -import com.zteits.urbanops.module.garden.dal.dataobject.hotline.HotlineCaseDO; -import com.zteits.urbanops.module.garden.dal.dataobject.hotline.HotlineFileDO; -import com.zteits.urbanops.module.garden.dal.dataobject.photo.SysPhotoDO; -import lombok.Data; - -import java.util.List; - -@Data -public class HotlineCaseDetailResp { - private HotlineCaseDO caseInfo; - private List files; - private List photos; -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/hotlinecase/HotlineCaseController.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/hotlinecase/HotlineCaseController.java new file mode 100644 index 0000000..c2acc34 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/hotlinecase/HotlineCaseController.java @@ -0,0 +1,104 @@ +package com.zteits.urbanops.module.garden.controller.admin.hotlinecase; + +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import jakarta.validation.constraints.*; +import jakarta.validation.*; +import jakarta.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.zteits.urbanops.framework.common.pojo.PageParam; +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.common.pojo.CommonResult; +import com.zteits.urbanops.framework.common.util.object.BeanUtils; +import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; + +import com.zteits.urbanops.framework.excel.core.util.ExcelUtils; + +import com.zteits.urbanops.framework.apilog.core.annotation.ApiAccessLog; +import static com.zteits.urbanops.framework.apilog.core.enums.OperateTypeEnum.*; + +import com.zteits.urbanops.module.garden.controller.admin.hotlinecase.vo.*; +import com.zteits.urbanops.module.garden.dal.dataobject.hotlinecase.HotlineCaseDO; +import com.zteits.urbanops.module.garden.service.hotlinecase.HotlineCaseService; + +@Tag(name = "管理后台 - 12345案件信息") +@RestController +@RequestMapping("/garden/hotline-case") +@Validated +public class HotlineCaseController { + + @Resource + private HotlineCaseService hotlineCaseService; + + @PostMapping("/create") + @Operation(summary = "创建12345案件信息") + @PreAuthorize("@ss.hasPermission('garden:hotline-case:create')") + public CommonResult createHotlineCase(@Valid @RequestBody HotlineCaseSaveReqVO createReqVO) { + return success(hotlineCaseService.createHotlineCase(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新12345案件信息") + @PreAuthorize("@ss.hasPermission('garden:hotline-case:update')") + public CommonResult updateHotlineCase(@Valid @RequestBody HotlineCaseSaveReqVO updateReqVO) { + hotlineCaseService.updateHotlineCase(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除12345案件信息") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('garden:hotline-case:delete')") + public CommonResult deleteHotlineCase(@RequestParam("id") String id) { + hotlineCaseService.deleteHotlineCase(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除12345案件信息") + @PreAuthorize("@ss.hasPermission('garden:hotline-case:delete')") + public CommonResult deleteHotlineCaseList(@RequestParam("ids") List ids) { + hotlineCaseService.deleteHotlineCaseListByIds(ids); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得12345案件信息") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('garden:hotline-case:query')") + public CommonResult getHotlineCase(@RequestParam("id") String id) { + HotlineCaseDO hotlineCase = hotlineCaseService.getHotlineCase(id); + return success(BeanUtils.toBean(hotlineCase, HotlineCaseRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得12345案件信息分页") + @PreAuthorize("@ss.hasPermission('garden:hotline-case:query')") + public CommonResult> getHotlineCasePage(@Valid HotlineCasePageReqVO pageReqVO) { + PageResult pageResult = hotlineCaseService.getHotlineCasePage(pageReqVO); + return success(BeanUtils.toBean(pageResult, HotlineCaseRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出12345案件信息 Excel") + @PreAuthorize("@ss.hasPermission('garden:hotline-case:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportHotlineCaseExcel(@Valid HotlineCasePageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = hotlineCaseService.getHotlineCasePage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "12345案件信息.xls", "数据", HotlineCaseRespVO.class, + BeanUtils.toBean(list, HotlineCaseRespVO.class)); + } + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/hotlinecase/vo/HotlineCasePageReqVO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/hotlinecase/vo/HotlineCasePageReqVO.java new file mode 100644 index 0000000..158f24c --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/hotlinecase/vo/HotlineCasePageReqVO.java @@ -0,0 +1,153 @@ +package com.zteits.urbanops.module.garden.controller.admin.hotlinecase.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zteits.urbanops.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 12345案件信息分页 Request VO") +@Data +public class HotlineCasePageReqVO extends PageParam { + + @Schema(description = "工单编号") + private String hotlinenumber; + + @Schema(description = "12345工单文件") + private String casefile; + + @Schema(description = "事间来源:默认12345") + private String eventsouce; + + @Schema(description = "工单来源:集团 分公司") + private String casesource; + + @Schema(description = "市级编号") + private String citynum; + + @Schema(description = "区级编号") + private String regionnum; + + @Schema(description = "工单状态") + private String taskstate; + + @Schema(description = "权属信息 null 无 0权属 1非权属") + private String ownership; + + @Schema(description = "部门信息") + private String department; + + @Schema(description = "所属街道") + private String street; + + @Schema(description = "所属公司", example = "26510") + private String companyid; + + @Schema(description = "来电人姓名", example = "芋艿") + private String callName; + + @Schema(description = "来电人手机号") + private String callTel; + + @Schema(description = "接件时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] acceptcasetime; + + @Schema(description = "截止时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] endTime; + + @Schema(description = "详细地址") + private String address; + + @Schema(description = "工单内容") + private String content; + + @Schema(description = "工单照片") + private String casepic; + + @Schema(description = "是否派巡查") + private String dispatcher; + + @Schema(description = "巡查员") + private String dispperson; + + @Schema(description = "完成情况") + private String replyResult; + + @Schema(description = "完成图片1") + private String picResult1; + + @Schema(description = "完成图片2") + private String picResult2; + + @Schema(description = "完成图片3") + private String picResult3; + + @Schema(description = "工单完成时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] finishTime; + + @Schema(description = "回复居民时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] replayrtime; + + @Schema(description = "权属单位") + private String ownercompany; + + @Schema(description = "工单类型", example = "2") + private String casetype; + + @Schema(description = "办理结果:字典") + private String handingresult; + + @Schema(description = "处理情况") + private String resolvedesp; + + @Schema(description = "处理情况") + private String rstResolvedesp; + + @Schema(description = "转单人") + private String dealBy; + + @Schema(description = "上报时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] dealTime; + + @Schema(description = "创建人") + private String createBy; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "修改人") + private String updateBy; + + @Schema(description = "结果录入人") + private String replayBy; + + @Schema(description = "回复时间,结果录入时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] replayTime; + + @Schema(description = "确认权属人") + private String ownershipBy; + + @Schema(description = "确认权属时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] ownershipTime; + + @Schema(description = "防止重复派单:1已经发送") + private String reserve1; + + @Schema(description = "小程序派单状态:1 待派单,2 派单中 3 派单处理完成") + private String reserve2; + + @Schema(description = "备注3") + private String reserve3; + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/hotlinecase/vo/HotlineCaseRespVO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/hotlinecase/vo/HotlineCaseRespVO.java new file mode 100644 index 0000000..a7a9e63 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/hotlinecase/vo/HotlineCaseRespVO.java @@ -0,0 +1,191 @@ +package com.zteits.urbanops.module.garden.controller.admin.hotlinecase.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import cn.idev.excel.annotation.*; + +@Schema(description = "管理后台 - 12345案件信息 Response VO") +@Data +@ExcelIgnoreUnannotated +public class HotlineCaseRespVO { + + @Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "9027") + @ExcelProperty("id") + private String id; + + @Schema(description = "工单编号") + @ExcelProperty("工单编号") + private String hotlinenumber; + + @Schema(description = "12345工单文件") + @ExcelProperty("12345工单文件") + private String casefile; + + @Schema(description = "事间来源:默认12345") + @ExcelProperty("事间来源:默认12345") + private String eventsouce; + + @Schema(description = "工单来源:集团 分公司") + @ExcelProperty("工单来源:集团 分公司") + private String casesource; + + @Schema(description = "市级编号", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("市级编号") + private String citynum; + + @Schema(description = "区级编号") + @ExcelProperty("区级编号") + private String regionnum; + + @Schema(description = "工单状态") + @ExcelProperty("工单状态") + private String taskstate; + + @Schema(description = "权属信息 null 无 0权属 1非权属") + @ExcelProperty("权属信息 null 无 0权属 1非权属") + private String ownership; + + @Schema(description = "部门信息") + @ExcelProperty("部门信息") + private String department; + + @Schema(description = "所属街道") + @ExcelProperty("所属街道") + private String street; + + @Schema(description = "所属公司", example = "26510") + @ExcelProperty("所属公司") + private String companyid; + + @Schema(description = "来电人姓名", example = "芋艿") + @ExcelProperty("来电人姓名") + private String callName; + + @Schema(description = "来电人手机号") + @ExcelProperty("来电人手机号") + private String callTel; + + @Schema(description = "接件时间") + @ExcelProperty("接件时间") + private LocalDateTime acceptcasetime; + + @Schema(description = "截止时间") + @ExcelProperty("截止时间") + private LocalDateTime endTime; + + @Schema(description = "详细地址") + @ExcelProperty("详细地址") + private String address; + + @Schema(description = "工单内容") + @ExcelProperty("工单内容") + private String content; + + @Schema(description = "工单照片") + @ExcelProperty("工单照片") + private String casepic; + + @Schema(description = "是否派巡查") + @ExcelProperty("是否派巡查") + private String dispatcher; + + @Schema(description = "巡查员") + @ExcelProperty("巡查员") + private String dispperson; + + @Schema(description = "完成情况") + @ExcelProperty("完成情况") + private String replyResult; + + @Schema(description = "完成图片1") + @ExcelProperty("完成图片1") + private String picResult1; + + @Schema(description = "完成图片2") + @ExcelProperty("完成图片2") + private String picResult2; + + @Schema(description = "完成图片3") + @ExcelProperty("完成图片3") + private String picResult3; + + @Schema(description = "工单完成时间") + @ExcelProperty("工单完成时间") + private LocalDateTime finishTime; + + @Schema(description = "回复居民时间") + @ExcelProperty("回复居民时间") + private LocalDateTime replayrtime; + + @Schema(description = "权属单位") + @ExcelProperty("权属单位") + private String ownercompany; + + @Schema(description = "工单类型", example = "2") + @ExcelProperty("工单类型") + private String casetype; + + @Schema(description = "办理结果:字典") + @ExcelProperty("办理结果:字典") + private String handingresult; + + @Schema(description = "处理情况") + @ExcelProperty("处理情况") + private String resolvedesp; + + @Schema(description = "处理情况") + @ExcelProperty("处理情况") + private String rstResolvedesp; + + @Schema(description = "转单人") + @ExcelProperty("转单人") + private String dealBy; + + @Schema(description = "上报时间") + @ExcelProperty("上报时间") + private LocalDateTime dealTime; + + @Schema(description = "创建人") + @ExcelProperty("创建人") + private String createBy; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "修改人") + @ExcelProperty("修改人") + private String updateBy; + + @Schema(description = "结果录入人") + @ExcelProperty("结果录入人") + private String replayBy; + + @Schema(description = "回复时间,结果录入时间") + @ExcelProperty("回复时间,结果录入时间") + private LocalDateTime replayTime; + + @Schema(description = "确认权属人") + @ExcelProperty("确认权属人") + private String ownershipBy; + + @Schema(description = "确认权属时间") + @ExcelProperty("确认权属时间") + private LocalDateTime ownershipTime; + + @Schema(description = "防止重复派单:1已经发送") + @ExcelProperty("防止重复派单:1已经发送") + private String reserve1; + + @Schema(description = "小程序派单状态:1 待派单,2 派单中 3 派单处理完成") + @ExcelProperty("小程序派单状态:1 待派单,2 派单中 3 派单处理完成") + private String reserve2; + + @Schema(description = "备注3") + @ExcelProperty("备注3") + private String reserve3; + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/hotlinecase/vo/HotlineCaseSaveReqVO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/hotlinecase/vo/HotlineCaseSaveReqVO.java new file mode 100644 index 0000000..585b620 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/hotlinecase/vo/HotlineCaseSaveReqVO.java @@ -0,0 +1,144 @@ +package com.zteits.urbanops.module.garden.controller.admin.hotlinecase.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 12345案件信息新增/修改 Request VO") +@Data +public class HotlineCaseSaveReqVO { + + @Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "9027") + private String id; + + @Schema(description = "工单编号") + private String hotlinenumber; + + @Schema(description = "12345工单文件") + private String casefile; + + @Schema(description = "事间来源:默认12345") + private String eventsouce; + + @Schema(description = "工单来源:集团 分公司") + private String casesource; + + @Schema(description = "市级编号", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "市级编号不能为空") + private String citynum; + + @Schema(description = "区级编号") + private String regionnum; + + @Schema(description = "工单状态") + private String taskstate; + + @Schema(description = "权属信息 null 无 0权属 1非权属") + private String ownership; + + @Schema(description = "部门信息") + private String department; + + @Schema(description = "所属街道") + private String street; + + @Schema(description = "所属公司", example = "26510") + private String companyid; + + @Schema(description = "来电人姓名", example = "芋艿") + private String callName; + + @Schema(description = "来电人手机号") + private String callTel; + + @Schema(description = "接件时间") + private LocalDateTime acceptcasetime; + + @Schema(description = "截止时间") + private LocalDateTime endTime; + + @Schema(description = "详细地址") + private String address; + + @Schema(description = "工单内容") + private String content; + + @Schema(description = "工单照片") + private String casepic; + + @Schema(description = "是否派巡查") + private String dispatcher; + + @Schema(description = "巡查员") + private String dispperson; + + @Schema(description = "完成情况") + private String replyResult; + + @Schema(description = "完成图片1") + private String picResult1; + + @Schema(description = "完成图片2") + private String picResult2; + + @Schema(description = "完成图片3") + private String picResult3; + + @Schema(description = "工单完成时间") + private LocalDateTime finishTime; + + @Schema(description = "回复居民时间") + private LocalDateTime replayrtime; + + @Schema(description = "权属单位") + private String ownercompany; + + @Schema(description = "工单类型", example = "2") + private String casetype; + + @Schema(description = "办理结果:字典") + private String handingresult; + + @Schema(description = "处理情况") + private String resolvedesp; + + @Schema(description = "处理情况") + private String rstResolvedesp; + + @Schema(description = "转单人") + private String dealBy; + + @Schema(description = "上报时间") + private LocalDateTime dealTime; + + @Schema(description = "创建人") + private String createBy; + + @Schema(description = "修改人") + private String updateBy; + + @Schema(description = "结果录入人") + private String replayBy; + + @Schema(description = "回复时间,结果录入时间") + private LocalDateTime replayTime; + + @Schema(description = "确认权属人") + private String ownershipBy; + + @Schema(description = "确认权属时间") + private LocalDateTime ownershipTime; + + @Schema(description = "防止重复派单:1已经发送") + private String reserve1; + + @Schema(description = "小程序派单状态:1 待派单,2 派单中 3 派单处理完成") + private String reserve2; + + @Schema(description = "备注3") + private String reserve3; + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/hotlinefile/HotlineFileController.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/hotlinefile/HotlineFileController.java new file mode 100644 index 0000000..53bb300 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/hotlinefile/HotlineFileController.java @@ -0,0 +1,104 @@ +package com.zteits.urbanops.module.garden.controller.admin.hotlinefile; + +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import jakarta.validation.constraints.*; +import jakarta.validation.*; +import jakarta.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.zteits.urbanops.framework.common.pojo.PageParam; +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.common.pojo.CommonResult; +import com.zteits.urbanops.framework.common.util.object.BeanUtils; +import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; + +import com.zteits.urbanops.framework.excel.core.util.ExcelUtils; + +import com.zteits.urbanops.framework.apilog.core.annotation.ApiAccessLog; +import static com.zteits.urbanops.framework.apilog.core.enums.OperateTypeEnum.*; + +import com.zteits.urbanops.module.garden.controller.admin.hotlinefile.vo.*; +import com.zteits.urbanops.module.garden.dal.dataobject.hotlinefile.HotlineFileDO; +import com.zteits.urbanops.module.garden.service.hotlinefile.HotlineFileService; + +@Tag(name = "管理后台 - 12345案件-文件") +@RestController +@RequestMapping("/garden/hotline-file") +@Validated +public class HotlineFileController { + + @Resource + private HotlineFileService hotlineFileService; + + @PostMapping("/create") + @Operation(summary = "创建12345案件-文件") + @PreAuthorize("@ss.hasPermission('garden:hotline-file:create')") + public CommonResult createHotlineFile(@Valid @RequestBody HotlineFileSaveReqVO createReqVO) { + return success(hotlineFileService.createHotlineFile(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新12345案件-文件") + @PreAuthorize("@ss.hasPermission('garden:hotline-file:update')") + public CommonResult updateHotlineFile(@Valid @RequestBody HotlineFileSaveReqVO updateReqVO) { + hotlineFileService.updateHotlineFile(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除12345案件-文件") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('garden:hotline-file:delete')") + public CommonResult deleteHotlineFile(@RequestParam("id") String id) { + hotlineFileService.deleteHotlineFile(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除12345案件-文件") + @PreAuthorize("@ss.hasPermission('garden:hotline-file:delete')") + public CommonResult deleteHotlineFileList(@RequestParam("ids") List ids) { + hotlineFileService.deleteHotlineFileListByIds(ids); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得12345案件-文件") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('garden:hotline-file:query')") + public CommonResult getHotlineFile(@RequestParam("id") String id) { + HotlineFileDO hotlineFile = hotlineFileService.getHotlineFile(id); + return success(BeanUtils.toBean(hotlineFile, HotlineFileRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得12345案件-文件分页") + @PreAuthorize("@ss.hasPermission('garden:hotline-file:query')") + public CommonResult> getHotlineFilePage(@Valid HotlineFilePageReqVO pageReqVO) { + PageResult pageResult = hotlineFileService.getHotlineFilePage(pageReqVO); + return success(BeanUtils.toBean(pageResult, HotlineFileRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出12345案件-文件 Excel") + @PreAuthorize("@ss.hasPermission('garden:hotline-file:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportHotlineFileExcel(@Valid HotlineFilePageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = hotlineFileService.getHotlineFilePage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "12345案件-文件.xls", "数据", HotlineFileRespVO.class, + BeanUtils.toBean(list, HotlineFileRespVO.class)); + } + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/hotlinefile/vo/HotlineFilePageReqVO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/hotlinefile/vo/HotlineFilePageReqVO.java new file mode 100644 index 0000000..7d61398 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/hotlinefile/vo/HotlineFilePageReqVO.java @@ -0,0 +1,29 @@ +package com.zteits.urbanops.module.garden.controller.admin.hotlinefile.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zteits.urbanops.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 12345案件-文件分页 Request VO") +@Data +public class HotlineFilePageReqVO extends PageParam { + + @Schema(description = "12345案件id", example = "21278") + private String caseId; + + @Schema(description = "文件id", example = "28882") + private String fileid; + + @Schema(description = "文件类型(办理文件、挂账文件、剔除文件等)", example = "2") + private String filetype; + + @Schema(description = "文件上传时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] updatetime; + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/hotlinefile/vo/HotlineFileRespVO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/hotlinefile/vo/HotlineFileRespVO.java new file mode 100644 index 0000000..0bbd655 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/hotlinefile/vo/HotlineFileRespVO.java @@ -0,0 +1,31 @@ +package com.zteits.urbanops.module.garden.controller.admin.hotlinefile.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import cn.idev.excel.annotation.*; + +@Schema(description = "管理后台 - 12345案件-文件 Response VO") +@Data +@ExcelIgnoreUnannotated +public class HotlineFileRespVO { + + @Schema(description = "12345案件id", example = "21278") + @ExcelProperty("12345案件id") + private String caseId; + + @Schema(description = "文件id", example = "28882") + @ExcelProperty("文件id") + private String fileid; + + @Schema(description = "文件类型(办理文件、挂账文件、剔除文件等)", example = "2") + @ExcelProperty("文件类型(办理文件、挂账文件、剔除文件等)") + private String filetype; + + @Schema(description = "文件上传时间") + @ExcelProperty("文件上传时间") + private LocalDateTime updatetime; + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/hotlinefile/vo/HotlineFileSaveReqVO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/hotlinefile/vo/HotlineFileSaveReqVO.java new file mode 100644 index 0000000..34eae36 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/hotlinefile/vo/HotlineFileSaveReqVO.java @@ -0,0 +1,26 @@ +package com.zteits.urbanops.module.garden.controller.admin.hotlinefile.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 12345案件-文件新增/修改 Request VO") +@Data +public class HotlineFileSaveReqVO { + + @Schema(description = "12345案件id", example = "21278") + private String caseId; + + @Schema(description = "文件id", example = "28882") + private String fileid; + + @Schema(description = "文件类型(办理文件、挂账文件、剔除文件等)", example = "2") + private String filetype; + + @Schema(description = "文件上传时间") + private LocalDateTime updatetime; + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/maintainrate/MaintainRateController.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/maintainrate/MaintainRateController.java deleted file mode 100644 index b1c5c0b..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/maintainrate/MaintainRateController.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.zteits.urbanops.module.garden.controller.admin.maintainrate; - -import com.zteits.urbanops.framework.common.pojo.CommonResult; -import com.zteits.urbanops.framework.common.pojo.PageResult; -import com.zteits.urbanops.framework.excel.core.util.ExcelUtils; -import com.zteits.urbanops.framework.common.util.object.BeanUtils; -import com.zteits.urbanops.module.garden.controller.admin.maintainrate.vo.MaintainRatePageReqVO; -import com.zteits.urbanops.module.garden.controller.admin.maintainrate.vo.MaintainRateReqVO; -import com.zteits.urbanops.module.garden.controller.admin.maintainrate.vo.MaintainRateRespVO; -import com.zteits.urbanops.module.garden.dal.dataobject.maintainrate.MaintainRateDO; -import com.zteits.urbanops.module.garden.service.maintainrate.MaintainRateService; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; -import jakarta.annotation.Resource; -import jakarta.servlet.http.HttpServletResponse; -import jakarta.validation.Valid; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import java.io.IOException; -import java.util.List; - -import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; -import static com.zteits.urbanops.framework.apilog.core.enums.OperateTypeEnum.EXPORT; -import com.zteits.urbanops.framework.apilog.core.annotation.ApiAccessLog; - -@Tag(name = "管理后台 - 养护频次") -@RestController -@RequestMapping("/maintain/rate") -public class MaintainRateController { - - @Resource - private MaintainRateService maintainRateService; - - @PostMapping("/listForPage") - @Operation(summary = "养护频次-分页查询") - @PreAuthorize("@ss.hasPermission('garden:maintain-rate:query')") - public CommonResult> listForPage(@Valid @RequestBody MaintainRatePageReqVO reqVO) { - return success(maintainRateService.selectPage(reqVO)); - } - - @PostMapping("/getMaintainRateValue") - @Operation(summary = "养护频次-获取养护频次值") - @PreAuthorize("@ss.hasPermission('garden:maintain-rate:query')") - public CommonResult getMaintainRateValue(@Valid @RequestBody MaintainRateReqVO reqVO) { - return success(maintainRateService.getMaintainRateValue(reqVO)); - } - - @GetMapping("/selectMaintainRateByLevel") - @Operation(summary = "通过植物类型获取养护频次值") - @PreAuthorize("@ss.hasPermission('garden:maintain-rate:query')") - public CommonResult selectMaintainRateByLevel(@RequestParam("maintain_type_id") Integer maintainTypeId, - @RequestParam("level") Integer level) { - return success(maintainRateService.selectMaintainRateByLevel(maintainTypeId, level)); - } - - @GetMapping("/export") - @Operation(summary = "导出养护频次列表") - @PreAuthorize("@ss.hasPermission('garden:maintain-rate:export')") - @ApiAccessLog(operateType = EXPORT) - public void exportExcel(@Valid MaintainRatePageReqVO reqVO, HttpServletResponse response) throws IOException { - List list = maintainRateService.selectPage(reqVO).getList(); - ExcelUtils.write(response, "养护频次.xls", "数据", MaintainRateDO.class, - BeanUtils.toBean(list, MaintainRateDO.class)); - } - - @GetMapping("/{id}") - @Operation(summary = "养护频次-详情") - @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('garden:maintain-rate:query')") - public CommonResult getInfo(@PathVariable("id") Long id) { - return success(maintainRateService.selectById(id)); - } - - @PostMapping("/add") - @Operation(summary = "养护频次-添加") - @PreAuthorize("@ss.hasPermission('garden:maintain-rate:create')") - public CommonResult add(@Valid @RequestBody MaintainRateDO entity) { - entity.setStatus("0"); - return success(maintainRateService.insert(entity)); - } - - @PostMapping("/edit") - @Operation(summary = "养护频次-修改") - @PreAuthorize("@ss.hasPermission('garden:maintain-rate:update')") - public CommonResult edit(@Valid @RequestBody MaintainRateDO entity) { - return success(maintainRateService.update(entity)); - } - - @GetMapping("/delete/byId") - @Operation(summary = "养护频次-删除") - @PreAuthorize("@ss.hasPermission('garden:maintain-rate:delete')") - public CommonResult deleteById(@RequestParam("id") Long id) { - return success(maintainRateService.deleteById(id)); - } -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/maintainrate/vo/MaintainRatePageReqVO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/maintainrate/vo/MaintainRatePageReqVO.java deleted file mode 100644 index d84cab3..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/maintainrate/vo/MaintainRatePageReqVO.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.zteits.urbanops.module.garden.controller.admin.maintainrate.vo; - -import com.zteits.urbanops.framework.common.pojo.PageParam; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class MaintainRatePageReqVO extends PageParam { - @Schema(description = "类型:1巡查;2养护") - private Integer type; - - @Schema(description = "科目ID") - private Integer maintainSubjectId; - - @Schema(description = "科目名称") - private String maintainSubjectName; - - @Schema(description = "养护类型ID") - private Integer maintainTypeId; - - @Schema(description = "养护类型名称") - private String maintainTypeName; - - @Schema(description = "周期ID") - private Integer cycleId; - - @Schema(description = "周期名称") - private String cycleName; - - @Schema(description = "状态") - private String status; -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/maintainrate/vo/MaintainRateReqVO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/maintainrate/vo/MaintainRateReqVO.java deleted file mode 100644 index 6e237e7..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/maintainrate/vo/MaintainRateReqVO.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.zteits.urbanops.module.garden.controller.admin.maintainrate.vo; - -import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.constraints.NotNull; -import lombok.Data; - -@Data -public class MaintainRateReqVO { - @NotNull - @Schema(description = "科目ID") - private Integer maintainSubjectId; - - @NotNull - @Schema(description = "养护类型ID") - private Integer maintainTypeId; -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/maintainrate/vo/MaintainRateRespVO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/maintainrate/vo/MaintainRateRespVO.java deleted file mode 100644 index ccbb556..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/maintainrate/vo/MaintainRateRespVO.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.zteits.urbanops.module.garden.controller.admin.maintainrate.vo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class MaintainRateRespVO { - @Schema(description = "养护类型ID") - private Integer maintainTypeId; - @Schema(description = "养护类型名称") - private String maintainTypeName; - - @Schema(description = "周期ID") - private Integer cycleId; - @Schema(description = "周期名称") - private String cycleName; - - @Schema(description = "特级频次") - private String levelTop; - @Schema(description = "一级频次") - private String levelOne; - @Schema(description = "二级频次") - private String levelTwo; - @Schema(description = "三级频次") - private String levelThree; - - @Schema(description = "根据等级选择的频次值") - private String value; -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/MaterialController.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/MaterialController.java new file mode 100644 index 0000000..4d7ad5e --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/MaterialController.java @@ -0,0 +1,104 @@ +package com.zteits.urbanops.module.garden.controller.admin.material; + +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import jakarta.validation.constraints.*; +import jakarta.validation.*; +import jakarta.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.zteits.urbanops.framework.common.pojo.PageParam; +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.common.pojo.CommonResult; +import com.zteits.urbanops.framework.common.util.object.BeanUtils; +import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; + +import com.zteits.urbanops.framework.excel.core.util.ExcelUtils; + +import com.zteits.urbanops.framework.apilog.core.annotation.ApiAccessLog; +import static com.zteits.urbanops.framework.apilog.core.enums.OperateTypeEnum.*; + +import com.zteits.urbanops.module.garden.controller.admin.material.vo.*; +import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialDO; +import com.zteits.urbanops.module.garden.service.material.MaterialService; + +@Tag(name = "管理后台 - 耗材管理") +@RestController +@RequestMapping("/garden/material") +@Validated +public class MaterialController { + + @Resource + private MaterialService materialService; + + @PostMapping("/create") + @Operation(summary = "创建耗材管理") + @PreAuthorize("@ss.hasPermission('garden:material:create')") + public CommonResult createMaterial(@Valid @RequestBody MaterialSaveReqVO createReqVO) { + return success(materialService.createMaterial(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新耗材管理") + @PreAuthorize("@ss.hasPermission('garden:material:update')") + public CommonResult updateMaterial(@Valid @RequestBody MaterialSaveReqVO updateReqVO) { + materialService.updateMaterial(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除耗材管理") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('garden:material:delete')") + public CommonResult deleteMaterial(@RequestParam("id") Long id) { + materialService.deleteMaterial(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除耗材管理") + @PreAuthorize("@ss.hasPermission('garden:material:delete')") + public CommonResult deleteMaterialList(@RequestParam("ids") List ids) { + materialService.deleteMaterialListByIds(ids); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得耗材管理") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('garden:material:query')") + public CommonResult getMaterial(@RequestParam("id") Long id) { + MaterialDO material = materialService.getMaterial(id); + return success(BeanUtils.toBean(material, MaterialRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得耗材管理分页") + @PreAuthorize("@ss.hasPermission('garden:material:query')") + public CommonResult> getMaterialPage(@Valid MaterialPageReqVO pageReqVO) { + PageResult pageResult = materialService.getMaterialPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, MaterialRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出耗材管理 Excel") + @PreAuthorize("@ss.hasPermission('garden:material:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportMaterialExcel(@Valid MaterialPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = materialService.getMaterialPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "耗材管理.xls", "数据", MaterialRespVO.class, + BeanUtils.toBean(list, MaterialRespVO.class)); + } + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/MaterialInController.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/MaterialInController.java deleted file mode 100644 index 30fa10c..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/MaterialInController.java +++ /dev/null @@ -1,151 +0,0 @@ -package com.zteits.urbanops.module.garden.controller.admin.material; - -import com.zteits.urbanops.framework.common.pojo.CommonResult; -import com.zteits.urbanops.framework.common.pojo.PageParam; -import com.zteits.urbanops.framework.common.pojo.PageResult; -import com.zteits.urbanops.framework.excel.core.util.ExcelUtils; -import com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils; -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialDO; -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialInventoryDO; -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialInventoryInDO; -import com.zteits.urbanops.module.garden.dal.mysql.material.MaterialInventoryInMapper; -import com.zteits.urbanops.module.garden.dal.mysql.material.MaterialInventoryMapper; -import com.zteits.urbanops.module.garden.service.material.MaterialService; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import jakarta.annotation.Resource; -import jakarta.servlet.http.HttpServletResponse; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.web.bind.annotation.*; - -import java.io.IOException; -import java.util.List; - -import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; - -@Tag(name = "管理后台 - 物料入库") -@RestController -@RequestMapping("/material/in") -public class MaterialInController { - - @Resource - private MaterialInventoryInMapper inMapper; - @Resource - private MaterialInventoryMapper inventoryMapper; - @Resource - private MaterialService materialService; - - @PostMapping("/listForPage") - @Operation(summary = "物料入库-分页") - @PreAuthorize("@ss.hasPermission('material:material/in:list')") - public CommonResult> listForPage(@RequestBody MaterialInventoryInDO where, - @RequestParam(value = "pageNum", required = false) Integer pageNum, - @RequestParam(value = "pageSize", required = false) Integer pageSize) { - PageParam page = new PageParam(); - page.setPageNo(pageNum == null ? 1 : pageNum); - page.setPageSize(pageSize == null ? 10 : pageSize); - PageResult result = inMapper.selectPage(page, null, - new com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX() - .eqIfPresent(MaterialInventoryInDO::getMaterialId, where.getMaterialId()) - .likeIfPresent(MaterialInventoryInDO::getMaterialName, where.getMaterialName()) - .eqIfPresent(MaterialInventoryInDO::getBelongCompanyId, where.getBelongCompanyId()) - .orderByDesc(MaterialInventoryInDO::getCreateTime)); - return success(result); - } - - @GetMapping("/export") - @Operation(summary = "物料入库-导出") - @PreAuthorize("@ss.hasPermission('material:material/in:export')") - public void export(MaterialInventoryInDO where, HttpServletResponse response) throws IOException { - List list = inMapper.selectList(new com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX() - .eqIfPresent(MaterialInventoryInDO::getMaterialId, where.getMaterialId())); - ExcelUtils.write(response, "物料入库.xls", "数据", MaterialInventoryInDO.class, list); - } - - @GetMapping("/select/by/inventoryInNo") - @Operation(summary = "物料入库-详情") - @PreAuthorize("@ss.hasPermission('material:material/in:query')") - public CommonResult getInfo(@RequestParam("inventoryIn_no") String inventoryInNo) { - return success(inMapper.selectByNo(inventoryInNo)); - } - - @PostMapping("/add") - @Operation(summary = "物料入库-添加") - @PreAuthorize("@ss.hasPermission('material:material/in:add')") - @Transactional(rollbackFor = Throwable.class) - public CommonResult add(@RequestBody MaterialInventoryInDO req) { - Long userId = SecurityFrameworkUtils.getLoginUserId(); - MaterialDO material = materialService.selectById(req.getMaterialId()); - if (material == null) { - return com.zteits.urbanops.framework.common.pojo.CommonResult.error(400, "无效参数-materialId"); - } - req.setCreator(String.valueOf(userId)); - req.setUpdater(String.valueOf(userId)); - boolean inserted = inMapper.insert(req) > 0; - - MaterialInventoryDO inventory = new MaterialInventoryDO(); - inventory.setMaterialId(req.getMaterialId()); - inventory.setMaterialName(req.getMaterialName()); - inventory.setMaterialTypeId(req.getMaterialTypeId()); - inventory.setMaterialTypeName(req.getMaterialTypeName()); - inventory.setTypeId(material.getTypeId()); - inventory.setTypeName(material.getTypeName()); - inventory.setTypeDetailId(material.getTypeDetailId()); - inventory.setTypeDetailName(material.getTypeDetailName()); - inventory.setSpecifications(req.getSpecifications()); - inventory.setBelongCompanyId(req.getBelongCompanyId()); - inventory.setBelongCompanyName(req.getBelongCompanyName()); - inventory.setUnitId(req.getUnitId()); - inventory.setUnitName(req.getUnitName()); - inventory.setCurrentNum(req.getInInventoryNum()); - inventory.setOutTotalNum(0L); - inventory.setInventoryTotalNum(req.getInInventoryNum()); - inventory.setStatus("0"); - inventory.setDeptId(SecurityFrameworkUtils.getLoginUserDeptId()); - - MaterialInventoryDO existed = inventoryMapper.selectByTypeDetailId(inventory.getTypeDetailId(), inventory.getBelongCompanyId()); - if (existed != null) { - MaterialInventoryDO upd = new MaterialInventoryDO(); - upd.setInventoryId(existed.getInventoryId()); - upd.setInventoryTotalNum((existed.getInventoryTotalNum() == null ? 0 : existed.getInventoryTotalNum()) + inventory.getCurrentNum()); - upd.setCurrentNum((existed.getCurrentNum() == null ? 0 : existed.getCurrentNum()) + inventory.getCurrentNum()); - inventoryMapper.updateById(upd); - } else { - inventoryMapper.insert(inventory); - } - - return success(inserted); - } - - @PostMapping("/edit") - @Operation(summary = "物料入库-修改") - @PreAuthorize("@ss.hasPermission('material:material/in:edit')") - public CommonResult edit(@RequestBody MaterialInventoryInDO req) { - return success(inMapper.updateById(req) > 0); - } - - @GetMapping("/delete/by/id") - @Operation(summary = "物料入库-删除") - @PreAuthorize("@ss.hasPermission('material:material/in:remove')") - @Transactional(rollbackFor = Throwable.class) - public CommonResult remove(@RequestParam("id") Long id) { - MaterialInventoryInDO in = inMapper.selectById(id); - if (in == null) { - return com.zteits.urbanops.framework.common.pojo.CommonResult.error(400, "参数错误"); - } - MaterialInventoryDO inv = inventoryMapper.selectByMaterialId(in.getMaterialId()); - if (inv == null) { - return com.zteits.urbanops.framework.common.pojo.CommonResult.error(400, "参数错误"); - } - if (inv.getCurrentNum() < in.getInInventoryNum()) { - return com.zteits.urbanops.framework.common.pojo.CommonResult.error(409, "库存已使用"); - } - MaterialInventoryDO upd = new MaterialInventoryDO(); - upd.setInventoryId(inv.getInventoryId()); - upd.setCurrentNum(inv.getCurrentNum() - in.getInInventoryNum()); - upd.setInventoryTotalNum(inv.getInventoryTotalNum() - in.getInInventoryNum()); - inventoryMapper.updateById(upd); - return success(inMapper.deleteById(id) > 0); - } -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/MaterialInventoryController.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/MaterialInventoryController.java deleted file mode 100644 index 06518f8..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/MaterialInventoryController.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.zteits.urbanops.module.garden.controller.admin.material; - -import com.zteits.urbanops.framework.common.pojo.CommonResult; -import com.zteits.urbanops.framework.common.pojo.PageParam; -import com.zteits.urbanops.framework.common.pojo.PageResult; -import com.zteits.urbanops.framework.excel.core.util.ExcelUtils; -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialInventoryDO; -import com.zteits.urbanops.module.garden.service.material.MaterialInventoryService; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import jakarta.annotation.Resource; -import jakarta.servlet.http.HttpServletResponse; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import java.io.IOException; -import java.util.List; - -import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; - -@Tag(name = "管理后台 - 物料库存") -@RestController -@RequestMapping("/material/inventory") -public class MaterialInventoryController { - - @Resource - private MaterialInventoryService inventoryService; - - @PostMapping("/listForPage") - @Operation(summary = "物料库存-分页查询") - @PreAuthorize("@ss.hasPermission('material:inventory:list')") - public CommonResult> listForPage(@RequestBody MaterialInventoryDO where, - @RequestParam(value = "pageNum", required = false) Integer pageNum, - @RequestParam(value = "pageSize", required = false) Integer pageSize) { - PageParam page = new PageParam(); - page.setPageNo(pageNum == null ? 1 : pageNum); - page.setPageSize(pageSize == null ? 10 : pageSize); - return success(inventoryService.selectPage(page, where)); - } - - @GetMapping("/export") - @Operation(summary = "物料库存-导出") - @PreAuthorize("@ss.hasPermission('material:inventory:export')") - public void export(MaterialInventoryDO where, HttpServletResponse response) throws IOException { - List list = inventoryService.selectPage(new PageParam(), where).getList(); - ExcelUtils.write(response, "物料库存.xls", "数据", MaterialInventoryDO.class, list); - } - - @GetMapping("/updateByAlermNum") - @Operation(summary = "物料库存-阈值更新") - @PreAuthorize("@ss.hasPermission('material:inventory:export')") - public CommonResult updateInventoryAlermNum(@RequestParam("material_id") Long materialId, - @RequestParam("alerm_num") Long alermNum) { - return success(inventoryService.updateInventoryAlarmNum(materialId, alermNum)); - } -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/MaterialManagerController.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/MaterialManagerController.java deleted file mode 100644 index 8a9d19a..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/MaterialManagerController.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.zteits.urbanops.module.garden.controller.admin.material; - -import com.zteits.urbanops.framework.common.pojo.CommonResult; -import com.zteits.urbanops.framework.common.pojo.PageParam; -import com.zteits.urbanops.framework.common.pojo.PageResult; -import com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils; -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialManagerDO; -import com.zteits.urbanops.module.garden.dal.mysql.material.MaterialManagerMapper; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import jakarta.annotation.Resource; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; - -@Tag(name = "管理后台 - 物料管理") -@RestController -@RequestMapping("/material/manager") -public class MaterialManagerController { - - @Resource - private MaterialManagerMapper mapper; - - @PostMapping("/listForPage") - @Operation(summary = "物料管理-分页") - @PreAuthorize("@ss.hasPermission('material:manager:list')") - public CommonResult> listForPage(@RequestBody MaterialManagerDO where, - @RequestParam(value = "pageNum", required = false) Integer pageNum, - @RequestParam(value = "pageSize", required = false) Integer pageSize) { - PageParam page = new PageParam(); - page.setPageNo(pageNum == null ? 1 : pageNum); - page.setPageSize(pageSize == null ? 10 : pageSize); - where.setDeptId(SecurityFrameworkUtils.getLoginUserDeptId()); - return success(mapper.selectPage(page, where)); - } - - @GetMapping("/list") - @Operation(summary = "物料管理-列表") - @PreAuthorize("@ss.hasPermission('material:manager:list')") - public CommonResult> list() { - MaterialManagerDO where = new MaterialManagerDO(); - where.setDeptId(SecurityFrameworkUtils.getLoginUserDeptId()); - return success(mapper.selectList(where)); - } - - @PostMapping("/add") - @Operation(summary = "物料管理-添加") - @PreAuthorize("@ss.hasPermission('material:manager:add')") - public CommonResult add(@RequestBody MaterialManagerDO entity) { - entity.setDeptId(SecurityFrameworkUtils.getLoginUserDeptId()); - entity.setCreator(String.valueOf(SecurityFrameworkUtils.getLoginUserId())); - entity.setUpdater(entity.getCreator()); - entity.clean(); - return success(mapper.insert(entity) > 0); - } - - @PostMapping("/edit") - @Operation(summary = "物料管理-修改") - @PreAuthorize("@ss.hasPermission('material:manager:edit')") - public CommonResult edit(@RequestBody MaterialManagerDO entity) { - entity.setUpdater(String.valueOf(SecurityFrameworkUtils.getLoginUserId())); - entity.clean(); - return success(mapper.updateById(entity) > 0); - } - - @GetMapping("/deleteById") - @Operation(summary = "物料管理-删除") - @PreAuthorize("@ss.hasPermission('material:manager:delete')") - public CommonResult deleteById(@RequestParam("id") Long id) { - return success(mapper.deleteById(id) > 0); - } -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/MaterialOutController.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/MaterialOutController.java deleted file mode 100644 index 03dc896..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/MaterialOutController.java +++ /dev/null @@ -1,126 +0,0 @@ -package com.zteits.urbanops.module.garden.controller.admin.material; - -import com.zteits.urbanops.framework.common.pojo.CommonResult; -import com.zteits.urbanops.framework.common.pojo.PageParam; -import com.zteits.urbanops.framework.common.pojo.PageResult; -import com.zteits.urbanops.framework.excel.core.util.ExcelUtils; -import com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils; -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialDO; -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialInventoryDO; -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialInventoryOutDO; -import com.zteits.urbanops.module.garden.dal.mysql.material.MaterialInventoryMapper; -import com.zteits.urbanops.module.garden.dal.mysql.material.MaterialInventoryOutMapper; -import com.zteits.urbanops.module.garden.service.material.MaterialService; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import jakarta.annotation.Resource; -import jakarta.servlet.http.HttpServletResponse; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.web.bind.annotation.*; - -import java.io.IOException; -import java.util.List; - -import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; - -@Tag(name = "管理后台 - 物料出库") -@RestController -@RequestMapping("/material/out") -public class MaterialOutController { - - @Resource - private MaterialInventoryOutMapper outMapper; - @Resource - private MaterialInventoryMapper inventoryMapper; - @Resource - private MaterialService materialService; - - @PostMapping("/listForPage") - @Operation(summary = "物料出库-分页") - @PreAuthorize("@ss.hasPermission('material:out:list')") - public CommonResult> listForPage(@RequestBody MaterialInventoryOutDO where, - @RequestParam(value = "pageNum", required = false) Integer pageNum, - @RequestParam(value = "pageSize", required = false) Integer pageSize) { - PageParam page = new PageParam(); - page.setPageNo(pageNum == null ? 1 : pageNum); - page.setPageSize(pageSize == null ? 10 : pageSize); - PageResult result = outMapper.selectPage(page, null, - new com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX() - .eqIfPresent(MaterialInventoryOutDO::getMaterialId, where.getMaterialId()) - .likeIfPresent(MaterialInventoryOutDO::getMaterialName, where.getMaterialName()) - .eqIfPresent(MaterialInventoryOutDO::getBelongCompanyId, where.getBelongCompanyId()) - .orderByDesc(MaterialInventoryOutDO::getCreateTime)); - return success(result); - } - - @GetMapping("/export") - @Operation(summary = "物料出库-导出") - @PreAuthorize("@ss.hasPermission('material:out:export')") - public void export(MaterialInventoryOutDO where, HttpServletResponse response) throws IOException { - List list = outMapper.selectList(new com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX() - .eqIfPresent(MaterialInventoryOutDO::getMaterialId, where.getMaterialId())); - ExcelUtils.write(response, "物料出库.xls", "数据", MaterialInventoryOutDO.class, list); - } - - @GetMapping("/{id}") - @Operation(summary = "物料出库-详情") - @PreAuthorize("@ss.hasPermission('material:out:query')") - public CommonResult getInfo(@RequestParam("id") Long id) { - return success(outMapper.selectById(id)); - } - - @PostMapping("/add") - @Operation(summary = "物料出库-添加") - @PreAuthorize("@ss.hasPermission('material:out:add')") - @Transactional(rollbackFor = Throwable.class) - public CommonResult add(@RequestBody MaterialInventoryOutDO req) { - Long userId = SecurityFrameworkUtils.getLoginUserId(); - MaterialDO material = materialService.selectById(req.getMaterialId()); - if (material == null) { - return com.zteits.urbanops.framework.common.pojo.CommonResult.error(400, "无效参数"); - } - MaterialInventoryDO inventory = inventoryMapper.selectByTypeDetailId(material.getTypeDetailId(), SecurityFrameworkUtils.getLoginUserDeptId()); - if (inventory == null) { - return com.zteits.urbanops.framework.common.pojo.CommonResult.error(400, req.getMaterialName() + "没有库存"); - } - if (inventory.getCurrentNum() < req.getOutInventoryNum()) { - return com.zteits.urbanops.framework.common.pojo.CommonResult.error(409, "当前库存不足,无法出库"); - } - req.setCreator(String.valueOf(userId)); - boolean inserted = outMapper.insert(req) > 0; - inventoryMapper.updateInventoryByMaterialId(inventory.getInventoryId(), req.getOutInventoryNum()); - return success(inserted); - } - - @PostMapping("/edit") - @Operation(summary = "物料出库-修改") - @PreAuthorize("@ss.hasPermission('material:out:edit')") - public CommonResult edit(@RequestBody MaterialInventoryOutDO req) { - return success(outMapper.updateById(req) > 0); - } - - @GetMapping("/delete/ById") - @Operation(summary = "物料出库-删除") - @PreAuthorize("@ss.hasPermission('material:out:remove')") - public CommonResult remove(@RequestParam("id") Long id) { - MaterialInventoryOutDO out = outMapper.selectById(id); - if (out == null) { - return com.zteits.urbanops.framework.common.pojo.CommonResult.error(400, "参数错误"); - } - MaterialInventoryDO inv = inventoryMapper.selectByMaterialId(out.getMaterialId()); - if (inv == null) { - return com.zteits.urbanops.framework.common.pojo.CommonResult.error(400, "参数错误"); - } - if (inv.getCurrentNum() < out.getOutInventoryNum()) { - return com.zteits.urbanops.framework.common.pojo.CommonResult.error(409, "库存已使用"); - } - MaterialInventoryDO upd = new MaterialInventoryDO(); - upd.setInventoryId(inv.getInventoryId()); - upd.setCurrentNum(inv.getCurrentNum() + out.getOutInventoryNum()); - upd.setInventoryTotalNum(inv.getInventoryTotalNum() + out.getOutInventoryNum()); - upd.setOutTotalNum(inv.getOutTotalNum() - out.getOutInventoryNum()); - inventoryMapper.updateById(upd); - return success(outMapper.deleteById(id) > 0); - } -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/vo/MaterialPageReqVO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/vo/MaterialPageReqVO.java new file mode 100644 index 0000000..097a2f5 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/vo/MaterialPageReqVO.java @@ -0,0 +1,71 @@ +package com.zteits.urbanops.module.garden.controller.admin.material.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zteits.urbanops.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 耗材管理分页 Request VO") +@Data +public class MaterialPageReqVO extends PageParam { + + @Schema(description = "完整编码") + private String fullCode; + + @Schema(description = "物料编码") + private String materialCode; + + @Schema(description = "耗材名称", example = "李四") + private String materialName; + + @Schema(description = "耗材类型ID", example = "3767") + private Long materialTypeId; + + @Schema(description = "耗材类型名称", example = "张三") + private String materialTypeName; + + @Schema(description = "类别ID", example = "25951") + private Long typeId; + + @Schema(description = "类别名称:药品", example = "张三") + private String typeName; + + @Schema(description = "类别明细ID", example = "5524") + private Long typeDetailId; + + @Schema(description = "类别明细", example = "赵六") + private String typeDetailName; + + @Schema(description = "规格编码") + private String specCode; + + @Schema(description = "规格") + private String specifications; + + @Schema(description = "归属公司ID", example = "990") + private Long belongCompanyId; + + @Schema(description = "归属公司", example = "王五") + private String belongCompanyName; + + @Schema(description = "单位ID", example = "14415") + private Long unitId; + + @Schema(description = "单位", example = "芋艿") + private String unitName; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "备注", example = "随便") + private String remark; + + @Schema(description = "是否关联工单:0-否,1-是") + private Integer isAssociatedOrder; + +} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/vo/MaterialRespVO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/vo/MaterialRespVO.java new file mode 100644 index 0000000..5458899 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/vo/MaterialRespVO.java @@ -0,0 +1,91 @@ +package com.zteits.urbanops.module.garden.controller.admin.material.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import cn.idev.excel.annotation.*; + +@Schema(description = "管理后台 - 耗材管理 Response VO") +@Data +@ExcelIgnoreUnannotated +public class MaterialRespVO { + + @Schema(description = "耗材ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14347") + @ExcelProperty("耗材ID") + private Long materialId; + + @Schema(description = "完整编码") + @ExcelProperty("完整编码") + private String fullCode; + + @Schema(description = "物料编码") + @ExcelProperty("物料编码") + private String materialCode; + + @Schema(description = "耗材名称", example = "李四") + @ExcelProperty("耗材名称") + private String materialName; + + @Schema(description = "耗材类型ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "3767") + @ExcelProperty("耗材类型ID") + private Long materialTypeId; + + @Schema(description = "耗材类型名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") + @ExcelProperty("耗材类型名称") + private String materialTypeName; + + @Schema(description = "类别ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25951") + @ExcelProperty("类别ID") + private Long typeId; + + @Schema(description = "类别名称:药品", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") + @ExcelProperty("类别名称:药品") + private String typeName; + + @Schema(description = "类别明细ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "5524") + @ExcelProperty("类别明细ID") + private Long typeDetailId; + + @Schema(description = "类别明细", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") + @ExcelProperty("类别明细") + private String typeDetailName; + + @Schema(description = "规格编码") + @ExcelProperty("规格编码") + private String specCode; + + @Schema(description = "规格", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("规格") + private String specifications; + + @Schema(description = "归属公司ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "990") + @ExcelProperty("归属公司ID") + private Long belongCompanyId; + + @Schema(description = "归属公司", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") + @ExcelProperty("归属公司") + private String belongCompanyName; + + @Schema(description = "单位ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14415") + @ExcelProperty("单位ID") + private Long unitId; + + @Schema(description = "单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") + @ExcelProperty("单位") + private String unitName; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED, example = "随便") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "是否关联工单:0-否,1-是") + @ExcelProperty("是否关联工单:0-否,1-是") + private Integer isAssociatedOrder; + +} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/vo/MaterialSaveReqVO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/vo/MaterialSaveReqVO.java new file mode 100644 index 0000000..65222b1 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/vo/MaterialSaveReqVO.java @@ -0,0 +1,78 @@ +package com.zteits.urbanops.module.garden.controller.admin.material.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; + +@Schema(description = "管理后台 - 耗材管理新增/修改 Request VO") +@Data +public class MaterialSaveReqVO { + + @Schema(description = "耗材ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14347") + private Long materialId; + + @Schema(description = "完整编码") + private String fullCode; + + @Schema(description = "物料编码") + private String materialCode; + + @Schema(description = "耗材名称", example = "李四") + private String materialName; + + @Schema(description = "耗材类型ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "3767") + @NotNull(message = "耗材类型ID不能为空") + private Long materialTypeId; + + @Schema(description = "耗材类型名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") + @NotEmpty(message = "耗材类型名称不能为空") + private String materialTypeName; + + @Schema(description = "类别ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25951") + @NotNull(message = "类别ID不能为空") + private Long typeId; + + @Schema(description = "类别名称:药品", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") + @NotEmpty(message = "类别名称:药品不能为空") + private String typeName; + + @Schema(description = "类别明细ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "5524") + @NotNull(message = "类别明细ID不能为空") + private Long typeDetailId; + + @Schema(description = "类别明细", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") + @NotEmpty(message = "类别明细不能为空") + private String typeDetailName; + + @Schema(description = "规格编码") + private String specCode; + + @Schema(description = "规格", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "规格不能为空") + private String specifications; + + @Schema(description = "归属公司ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "990") + @NotNull(message = "归属公司ID不能为空") + private Long belongCompanyId; + + @Schema(description = "归属公司", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") + @NotEmpty(message = "归属公司不能为空") + private String belongCompanyName; + + @Schema(description = "单位ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14415") + @NotNull(message = "单位ID不能为空") + private Long unitId; + + @Schema(description = "单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") + @NotEmpty(message = "单位不能为空") + private String unitName; + + @Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED, example = "随便") + @NotEmpty(message = "备注不能为空") + private String remark; + + @Schema(description = "是否关联工单:0-否,1-是") + private Integer isAssociatedOrder; + +} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventory/MaterialInventoryController.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventory/MaterialInventoryController.java new file mode 100644 index 0000000..620489a --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventory/MaterialInventoryController.java @@ -0,0 +1,115 @@ +package com.zteits.urbanops.module.garden.controller.admin.materialinventory; + +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import jakarta.validation.constraints.*; +import jakarta.validation.*; +import jakarta.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.zteits.urbanops.framework.common.pojo.PageParam; +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.common.pojo.CommonResult; +import com.zteits.urbanops.framework.common.util.object.BeanUtils; +import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; + +import com.zteits.urbanops.framework.excel.core.util.ExcelUtils; + +import com.zteits.urbanops.framework.apilog.core.annotation.ApiAccessLog; +import static com.zteits.urbanops.framework.apilog.core.enums.OperateTypeEnum.*; + +import com.zteits.urbanops.module.garden.controller.admin.materialinventory.vo.*; +import com.zteits.urbanops.module.garden.dal.dataobject.materialinventory.MaterialInventoryDO; +import com.zteits.urbanops.module.garden.service.materialinventory.MaterialInventoryService; + +@Tag(name = "管理后台 - 物料库存") +@RestController +@RequestMapping("/garden/material-inventory") +@Validated +public class MaterialInventoryController { + + @Resource + private MaterialInventoryService materialInventoryService; + + @PostMapping("/create") + @Operation(summary = "创建物料库存") + @PreAuthorize("@ss.hasPermission('garden:material-inventory:create')") + public CommonResult createMaterialInventory(@Valid @RequestBody MaterialInventorySaveReqVO createReqVO) { + return success(materialInventoryService.createMaterialInventory(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新物料库存") + @PreAuthorize("@ss.hasPermission('garden:material-inventory:update')") + public CommonResult updateMaterialInventory(@Valid @RequestBody MaterialInventorySaveReqVO updateReqVO) { + materialInventoryService.updateMaterialInventory(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除物料库存") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('garden:material-inventory:delete')") + public CommonResult deleteMaterialInventory(@RequestParam("id") Long id) { + materialInventoryService.deleteMaterialInventory(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除物料库存") + @PreAuthorize("@ss.hasPermission('garden:material-inventory:delete')") + public CommonResult deleteMaterialInventoryList(@RequestParam("ids") List ids) { + materialInventoryService.deleteMaterialInventoryListByIds(ids); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得物料库存") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('garden:material-inventory:query')") + public CommonResult getMaterialInventory(@RequestParam("id") Long id) { + MaterialInventoryDO materialInventory = materialInventoryService.getMaterialInventory(id); + return success(BeanUtils.toBean(materialInventory, MaterialInventoryRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得物料库存分页") + @PreAuthorize("@ss.hasPermission('garden:material-inventory:query')") + public CommonResult> getMaterialInventoryPage(@Valid MaterialInventoryPageReqVO pageReqVO) { + PageResult pageResult = materialInventoryService.getMaterialInventoryPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, MaterialInventoryRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出物料库存 Excel") + @PreAuthorize("@ss.hasPermission('garden:material-inventory:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportMaterialInventoryExcel(@Valid MaterialInventoryPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = materialInventoryService.getMaterialInventoryPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "物料库存.xls", "数据", MaterialInventoryRespVO.class, + BeanUtils.toBean(list, MaterialInventoryRespVO.class)); + } + + /** + * 物料库存-阈值更新 + */ + @Operation(summary = "物料库存-阈值更新") + @PreAuthorize("@ss.hasPermission('garden:material-inventory:update')") + @GetMapping("/updateByAlermNum") + public CommonResult updateInventoryAlermNum(@RequestParam("material_id") Long materialId, @RequestParam("alerm_num") Long alermNum) { + int count = materialInventoryService.updateInVentoryAlremNum(materialId, alermNum); + return success(count); + } + +} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventory/vo/MaterialInventoryPageReqVO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventory/vo/MaterialInventoryPageReqVO.java new file mode 100644 index 0000000..88b1fb0 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventory/vo/MaterialInventoryPageReqVO.java @@ -0,0 +1,74 @@ +package com.zteits.urbanops.module.garden.controller.admin.materialinventory.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zteits.urbanops.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 物料库存分页 Request VO") +@Data +public class MaterialInventoryPageReqVO extends PageParam { + + @Schema(description = "物料ID", example = "29414") + private Long materialId; + + @Schema(description = "物料名称", example = "李四") + private String materialName; + + @Schema(description = "物料类型ID", example = "24853") + private Long materialTypeId; + + @Schema(description = "耗材类型名称", example = "芋艿") + private String materialTypeName; + + @Schema(description = "类别ID", example = "30568") + private Long typeId; + + @Schema(description = "类别名称:药品", example = "芋艿") + private String typeName; + + @Schema(description = "类别明细ID", example = "6252") + private Long typeDetailId; + + @Schema(description = "类别明细", example = "芋艿") + private String typeDetailName; + + @Schema(description = "规格") + private String specifications; + + @Schema(description = "归属单位ID", example = "25626") + private Long belongCompanyId; + + @Schema(description = "归属单位", example = "李四") + private String belongCompanyName; + + @Schema(description = "单位ID", example = "6480") + private Long unitId; + + @Schema(description = "单位", example = "王五") + private String unitName; + + @Schema(description = "当前库存数量") + private Long currentNum; + + @Schema(description = "出库总数量(出库累加)") + private Long outTotalNum; + + @Schema(description = "库存总数量(入库累加)") + private Long inventoryTotalNum; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "库存预警阈值") + private Long inventoryAlermNum; + + @Schema(description = "部门ID", example = "11349") + private Long deptId; + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventory/vo/MaterialInventoryRespVO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventory/vo/MaterialInventoryRespVO.java new file mode 100644 index 0000000..c66dffb --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventory/vo/MaterialInventoryRespVO.java @@ -0,0 +1,95 @@ +package com.zteits.urbanops.module.garden.controller.admin.materialinventory.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import cn.idev.excel.annotation.*; + +@Schema(description = "管理后台 - 物料库存 Response VO") +@Data +@ExcelIgnoreUnannotated +public class MaterialInventoryRespVO { + + @Schema(description = "库存ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "10980") + @ExcelProperty("库存ID") + private Long inventoryId; + + @Schema(description = "物料ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "29414") + @ExcelProperty("物料ID") + private Long materialId; + + @Schema(description = "物料名称", example = "李四") + @ExcelProperty("物料名称") + private String materialName; + + @Schema(description = "物料类型ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "24853") + @ExcelProperty("物料类型ID") + private Long materialTypeId; + + @Schema(description = "耗材类型名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") + @ExcelProperty("耗材类型名称") + private String materialTypeName; + + @Schema(description = "类别ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "30568") + @ExcelProperty("类别ID") + private Long typeId; + + @Schema(description = "类别名称:药品", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") + @ExcelProperty("类别名称:药品") + private String typeName; + + @Schema(description = "类别明细ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6252") + @ExcelProperty("类别明细ID") + private Long typeDetailId; + + @Schema(description = "类别明细", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") + @ExcelProperty("类别明细") + private String typeDetailName; + + @Schema(description = "规格", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("规格") + private String specifications; + + @Schema(description = "归属单位ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25626") + @ExcelProperty("归属单位ID") + private Long belongCompanyId; + + @Schema(description = "归属单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") + @ExcelProperty("归属单位") + private String belongCompanyName; + + @Schema(description = "单位ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6480") + @ExcelProperty("单位ID") + private Long unitId; + + @Schema(description = "单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") + @ExcelProperty("单位") + private String unitName; + + @Schema(description = "当前库存数量", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("当前库存数量") + private Long currentNum; + + @Schema(description = "出库总数量(出库累加)", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("出库总数量(出库累加)") + private Long outTotalNum; + + @Schema(description = "库存总数量(入库累加)", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("库存总数量(入库累加)") + private Long inventoryTotalNum; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "库存预警阈值", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("库存预警阈值") + private Long inventoryAlermNum; + + @Schema(description = "部门ID", example = "11349") + @ExcelProperty("部门ID") + private Long deptId; + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventory/vo/MaterialInventorySaveReqVO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventory/vo/MaterialInventorySaveReqVO.java new file mode 100644 index 0000000..e3e8600 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventory/vo/MaterialInventorySaveReqVO.java @@ -0,0 +1,85 @@ +package com.zteits.urbanops.module.garden.controller.admin.materialinventory.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; + +@Schema(description = "管理后台 - 物料库存新增/修改 Request VO") +@Data +public class MaterialInventorySaveReqVO { + + @Schema(description = "库存ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "10980") + private Long inventoryId; + + @Schema(description = "物料ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "29414") + @NotNull(message = "物料ID不能为空") + private Long materialId; + + @Schema(description = "物料名称", example = "李四") + private String materialName; + + @Schema(description = "物料类型ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "24853") + @NotNull(message = "物料类型ID不能为空") + private Long materialTypeId; + + @Schema(description = "耗材类型名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") + @NotEmpty(message = "耗材类型名称不能为空") + private String materialTypeName; + + @Schema(description = "类别ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "30568") + @NotNull(message = "类别ID不能为空") + private Long typeId; + + @Schema(description = "类别名称:药品", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") + @NotEmpty(message = "类别名称:药品不能为空") + private String typeName; + + @Schema(description = "类别明细ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6252") + @NotNull(message = "类别明细ID不能为空") + private Long typeDetailId; + + @Schema(description = "类别明细", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") + @NotEmpty(message = "类别明细不能为空") + private String typeDetailName; + + @Schema(description = "规格", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "规格不能为空") + private String specifications; + + @Schema(description = "归属单位ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25626") + @NotNull(message = "归属单位ID不能为空") + private Long belongCompanyId; + + @Schema(description = "归属单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") + @NotEmpty(message = "归属单位不能为空") + private String belongCompanyName; + + @Schema(description = "单位ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6480") + @NotNull(message = "单位ID不能为空") + private Long unitId; + + @Schema(description = "单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") + @NotEmpty(message = "单位不能为空") + private String unitName; + + @Schema(description = "当前库存数量", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "当前库存数量不能为空") + private Long currentNum; + + @Schema(description = "出库总数量(出库累加)", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "出库总数量(出库累加)不能为空") + private Long outTotalNum; + + @Schema(description = "库存总数量(入库累加)", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "库存总数量(入库累加)不能为空") + private Long inventoryTotalNum; + + @Schema(description = "库存预警阈值", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "库存预警阈值不能为空") + private Long inventoryAlermNum; + + @Schema(description = "部门ID", example = "11349") + private Long deptId; + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryin/MaterialInventoryInController.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryin/MaterialInventoryInController.java new file mode 100644 index 0000000..0147b5d --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryin/MaterialInventoryInController.java @@ -0,0 +1,104 @@ +package com.zteits.urbanops.module.garden.controller.admin.materialinventoryin; + +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import jakarta.validation.constraints.*; +import jakarta.validation.*; +import jakarta.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.zteits.urbanops.framework.common.pojo.PageParam; +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.common.pojo.CommonResult; +import com.zteits.urbanops.framework.common.util.object.BeanUtils; +import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; + +import com.zteits.urbanops.framework.excel.core.util.ExcelUtils; + +import com.zteits.urbanops.framework.apilog.core.annotation.ApiAccessLog; +import static com.zteits.urbanops.framework.apilog.core.enums.OperateTypeEnum.*; + +import com.zteits.urbanops.module.garden.controller.admin.materialinventoryin.vo.*; +import com.zteits.urbanops.module.garden.dal.dataobject.materialinventoryin.MaterialInventoryInDO; +import com.zteits.urbanops.module.garden.service.materialinventoryin.MaterialInventoryInService; + +@Tag(name = "管理后台 - 物料入库") +@RestController +@RequestMapping("/garden/material-inventory-in") +@Validated +public class MaterialInventoryInController { + + @Resource + private MaterialInventoryInService materialInventoryInService; + + @PostMapping("/create") + @Operation(summary = "创建物料入库") + @PreAuthorize("@ss.hasPermission('garden:material-inventory-in:create')") + public CommonResult createMaterialInventoryIn(@Valid @RequestBody MaterialInventoryInSaveReqVO createReqVO) { + return success(materialInventoryInService.createMaterialInventoryIn(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新物料入库") + @PreAuthorize("@ss.hasPermission('garden:material-inventory-in:update')") + public CommonResult updateMaterialInventoryIn(@Valid @RequestBody MaterialInventoryInSaveReqVO updateReqVO) { + materialInventoryInService.updateMaterialInventoryIn(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除物料入库") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('garden:material-inventory-in:delete')") + public CommonResult deleteMaterialInventoryIn(@RequestParam("id") Long id) { + materialInventoryInService.deleteMaterialInventoryIn(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除物料入库") + @PreAuthorize("@ss.hasPermission('garden:material-inventory-in:delete')") + public CommonResult deleteMaterialInventoryInList(@RequestParam("ids") List ids) { + materialInventoryInService.deleteMaterialInventoryInListByIds(ids); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得物料入库") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('garden:material-inventory-in:query')") + public CommonResult getMaterialInventoryIn(@RequestParam("id") Long id) { + MaterialInventoryInDO materialInventoryIn = materialInventoryInService.getMaterialInventoryIn(id); + return success(BeanUtils.toBean(materialInventoryIn, MaterialInventoryInRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得物料入库分页") + @PreAuthorize("@ss.hasPermission('garden:material-inventory-in:query')") + public CommonResult> getMaterialInventoryInPage(@Valid MaterialInventoryInPageReqVO pageReqVO) { + PageResult pageResult = materialInventoryInService.getMaterialInventoryInPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, MaterialInventoryInRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出物料入库 Excel") + @PreAuthorize("@ss.hasPermission('garden:material-inventory-in:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportMaterialInventoryInExcel(@Valid MaterialInventoryInPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = materialInventoryInService.getMaterialInventoryInPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "物料入库.xls", "数据", MaterialInventoryInRespVO.class, + BeanUtils.toBean(list, MaterialInventoryInRespVO.class)); + } + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryin/vo/MaterialInventoryInPageReqVO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryin/vo/MaterialInventoryInPageReqVO.java new file mode 100644 index 0000000..aa520fe --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryin/vo/MaterialInventoryInPageReqVO.java @@ -0,0 +1,85 @@ +package com.zteits.urbanops.module.garden.controller.admin.materialinventoryin.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zteits.urbanops.framework.common.pojo.PageParam; +import java.math.BigDecimal; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 物料入库分页 Request VO") +@Data +public class MaterialInventoryInPageReqVO extends PageParam { + + @Schema(description = "入库批次号") + private String inventoryInNo; + + @Schema(description = "物料ID", example = "7335") + private Long materialId; + + @Schema(description = "物料名称", example = "芋艿") + private String materialName; + + @Schema(description = "物料类型ID", example = "27813") + private Long materialTypeId; + + @Schema(description = "耗材类型名称", example = "李四") + private String materialTypeName; + + @Schema(description = "类别ID", example = "24913") + private Long typeId; + + @Schema(description = "类别名称:药品", example = "李四") + private String typeName; + + @Schema(description = "类别明细ID", example = "53") + private Long typeDetailId; + + @Schema(description = "类别明细", example = "张三") + private String typeDetailName; + + @Schema(description = "规格") + private String specifications; + + @Schema(description = "归属单位ID", example = "27639") + private Long belongCompanyId; + + @Schema(description = "归属单位", example = "王五") + private String belongCompanyName; + + @Schema(description = "入库数量") + private Long inInventoryNum; + + @Schema(description = "单价", example = "17670") + private BigDecimal materialPrice; + + @Schema(description = "单位ID", example = "11362") + private Long unitId; + + @Schema(description = "单位", example = "李四") + private String unitName; + + @Schema(description = "采购日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] buyDate; + + @Schema(description = "供应商名称", example = "王五") + private String supplierName; + + @Schema(description = "联系人", example = "赵六") + private String contactsName; + + @Schema(description = "联系人 电话") + private String contactsPhone; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "部门ID", example = "18025") + private Long deptId; + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryin/vo/MaterialInventoryInRespVO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryin/vo/MaterialInventoryInRespVO.java new file mode 100644 index 0000000..95fe8aa --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryin/vo/MaterialInventoryInRespVO.java @@ -0,0 +1,108 @@ +package com.zteits.urbanops.module.garden.controller.admin.materialinventoryin.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import java.math.BigDecimal; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import cn.idev.excel.annotation.*; + +@Schema(description = "管理后台 - 物料入库 Response VO") +@Data +@ExcelIgnoreUnannotated +public class MaterialInventoryInRespVO { + + @Schema(description = "入库ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16290") + @ExcelProperty("入库ID") + private Long id; + + @Schema(description = "入库批次号", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("入库批次号") + private String inventoryInNo; + + @Schema(description = "物料ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7335") + @ExcelProperty("物料ID") + private Long materialId; + + @Schema(description = "物料名称", example = "芋艿") + @ExcelProperty("物料名称") + private String materialName; + + @Schema(description = "物料类型ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "27813") + @ExcelProperty("物料类型ID") + private Long materialTypeId; + + @Schema(description = "耗材类型名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") + @ExcelProperty("耗材类型名称") + private String materialTypeName; + + @Schema(description = "类别ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "24913") + @ExcelProperty("类别ID") + private Long typeId; + + @Schema(description = "类别名称:药品", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") + @ExcelProperty("类别名称:药品") + private String typeName; + + @Schema(description = "类别明细ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "53") + @ExcelProperty("类别明细ID") + private Long typeDetailId; + + @Schema(description = "类别明细", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") + @ExcelProperty("类别明细") + private String typeDetailName; + + @Schema(description = "规格", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("规格") + private String specifications; + + @Schema(description = "归属单位ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "27639") + @ExcelProperty("归属单位ID") + private Long belongCompanyId; + + @Schema(description = "归属单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") + @ExcelProperty("归属单位") + private String belongCompanyName; + + @Schema(description = "入库数量", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("入库数量") + private Long inInventoryNum; + + @Schema(description = "单价", requiredMode = Schema.RequiredMode.REQUIRED, example = "17670") + @ExcelProperty("单价") + private BigDecimal materialPrice; + + @Schema(description = "单位ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11362") + @ExcelProperty("单位ID") + private Long unitId; + + @Schema(description = "单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") + @ExcelProperty("单位") + private String unitName; + + @Schema(description = "采购日期", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("采购日期") + private LocalDateTime buyDate; + + @Schema(description = "供应商名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") + @ExcelProperty("供应商名称") + private String supplierName; + + @Schema(description = "联系人", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") + @ExcelProperty("联系人") + private String contactsName; + + @Schema(description = "联系人 电话", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("联系人 电话") + private String contactsPhone; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "部门ID", example = "18025") + @ExcelProperty("部门ID") + private Long deptId; + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryin/vo/MaterialInventoryInSaveReqVO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryin/vo/MaterialInventoryInSaveReqVO.java new file mode 100644 index 0000000..3f35685 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryin/vo/MaterialInventoryInSaveReqVO.java @@ -0,0 +1,50 @@ +package com.zteits.urbanops.module.garden.controller.admin.materialinventoryin.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; +import java.math.BigDecimal; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 物料入库新增/修改 Request VO") +@Data +public class MaterialInventoryInSaveReqVO { + + @Schema(description = "入库ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16290") + private Long id; + + @Schema(description = "物料ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7335") + @NotNull(message = "物料ID不能为空") + private Long materialId; + + @Schema(description = "规格", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "规格不能为空") + private String specifications; + + @Schema(description = "入库数量", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "入库数量不能为空") + private Long inInventoryNum; + + @Schema(description = "单价", requiredMode = Schema.RequiredMode.REQUIRED, example = "17670") + @NotNull(message = "单价不能为空") + private BigDecimal materialPrice; + + @Schema(description = "采购日期", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "采购日期不能为空") + private LocalDateTime buyDate; + + @Schema(description = "供应商名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") + @NotEmpty(message = "供应商名称不能为空") + private String supplierName; + + @Schema(description = "联系人", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") + @NotEmpty(message = "联系人不能为空") + private String contactsName; + + @Schema(description = "联系人 电话", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "联系人 电话不能为空") + private String contactsPhone; + +} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryout/MaterialInventoryOutController.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryout/MaterialInventoryOutController.java new file mode 100644 index 0000000..0b63277 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryout/MaterialInventoryOutController.java @@ -0,0 +1,104 @@ +package com.zteits.urbanops.module.garden.controller.admin.materialinventoryout; + +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import jakarta.validation.constraints.*; +import jakarta.validation.*; +import jakarta.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.zteits.urbanops.framework.common.pojo.PageParam; +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.common.pojo.CommonResult; +import com.zteits.urbanops.framework.common.util.object.BeanUtils; +import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; + +import com.zteits.urbanops.framework.excel.core.util.ExcelUtils; + +import com.zteits.urbanops.framework.apilog.core.annotation.ApiAccessLog; +import static com.zteits.urbanops.framework.apilog.core.enums.OperateTypeEnum.*; + +import com.zteits.urbanops.module.garden.controller.admin.materialinventoryout.vo.*; +import com.zteits.urbanops.module.garden.dal.dataobject.materialinventoryout.MaterialInventoryOutDO; +import com.zteits.urbanops.module.garden.service.materialinventoryout.MaterialInventoryOutService; + +@Tag(name = "管理后台 - 物料出库") +@RestController +@RequestMapping("/garden/material-inventory-out") +@Validated +public class MaterialInventoryOutController { + + @Resource + private MaterialInventoryOutService materialInventoryOutService; + + @PostMapping("/create") + @Operation(summary = "创建物料出库") + @PreAuthorize("@ss.hasPermission('garden:material-inventory-out:create')") + public CommonResult createMaterialInventoryOut(@Valid @RequestBody MaterialInventoryOutSaveReqVO createReqVO) { + return success(materialInventoryOutService.createMaterialInventoryOut(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新物料出库") + @PreAuthorize("@ss.hasPermission('garden:material-inventory-out:update')") + public CommonResult updateMaterialInventoryOut(@Valid @RequestBody MaterialInventoryOutSaveReqVO updateReqVO) { + materialInventoryOutService.updateMaterialInventoryOut(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除物料出库") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('garden:material-inventory-out:delete')") + public CommonResult deleteMaterialInventoryOut(@RequestParam("id") Long id) { + materialInventoryOutService.deleteMaterialInventoryOut(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除物料出库") + @PreAuthorize("@ss.hasPermission('garden:material-inventory-out:delete')") + public CommonResult deleteMaterialInventoryOutList(@RequestParam("ids") List ids) { + materialInventoryOutService.deleteMaterialInventoryOutListByIds(ids); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得物料出库") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('garden:material-inventory-out:query')") + public CommonResult getMaterialInventoryOut(@RequestParam("id") Long id) { + MaterialInventoryOutDO materialInventoryOut = materialInventoryOutService.getMaterialInventoryOut(id); + return success(BeanUtils.toBean(materialInventoryOut, MaterialInventoryOutRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得物料出库分页") + @PreAuthorize("@ss.hasPermission('garden:material-inventory-out:query')") + public CommonResult> getMaterialInventoryOutPage(@Valid MaterialInventoryOutPageReqVO pageReqVO) { + PageResult pageResult = materialInventoryOutService.getMaterialInventoryOutPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, MaterialInventoryOutRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出物料出库 Excel") + @PreAuthorize("@ss.hasPermission('garden:material-inventory-out:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportMaterialInventoryOutExcel(@Valid MaterialInventoryOutPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = materialInventoryOutService.getMaterialInventoryOutPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "物料出库.xls", "数据", MaterialInventoryOutRespVO.class, + BeanUtils.toBean(list, MaterialInventoryOutRespVO.class)); + } + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryout/vo/MaterialInventoryOutPageReqVO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryout/vo/MaterialInventoryOutPageReqVO.java new file mode 100644 index 0000000..19ed20c --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryout/vo/MaterialInventoryOutPageReqVO.java @@ -0,0 +1,78 @@ +package com.zteits.urbanops.module.garden.controller.admin.materialinventoryout.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zteits.urbanops.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 物料出库分页 Request VO") +@Data +public class MaterialInventoryOutPageReqVO extends PageParam { + + @Schema(description = "入库批次号") + private String inventoryOutNo; + + @Schema(description = "物料ID", example = "14541") + private Long materialId; + + @Schema(description = "物料名称", example = "芋艿") + private String materialName; + + @Schema(description = "物料类型ID", example = "9209") + private Long materialTypeId; + + @Schema(description = "耗材类型名称", example = "王五") + private String materialTypeName; + + @Schema(description = "类别ID", example = "12624") + private Long typeId; + + @Schema(description = "类别名称:药品", example = "芋艿") + private String typeName; + + @Schema(description = "类别明细ID", example = "24611") + private Long typeDetailId; + + @Schema(description = "类别明细", example = "王五") + private String typeDetailName; + + @Schema(description = "规格") + private String specifications; + + @Schema(description = "归属单位ID", example = "17128") + private Long belongCompanyId; + + @Schema(description = "归属单位", example = "李四") + private String belongCompanyName; + + @Schema(description = "出库数量") + private Long outInventoryNum; + + @Schema(description = "单位ID", example = "1033") + private Long unitId; + + @Schema(description = "单位", example = "芋艿") + private String unitName; + + @Schema(description = "出库日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] outDate; + + @Schema(description = "备注", example = "你说的对") + private String remark; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "部门ID", example = "22618") + private Long deptId; + + @Schema(description = "类型: 1:手动出库;2:养护类出库", example = "1") + private Integer type; + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryout/vo/MaterialInventoryOutRespVO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryout/vo/MaterialInventoryOutRespVO.java new file mode 100644 index 0000000..f05118a --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryout/vo/MaterialInventoryOutRespVO.java @@ -0,0 +1,99 @@ +package com.zteits.urbanops.module.garden.controller.admin.materialinventoryout.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import cn.idev.excel.annotation.*; + +@Schema(description = "管理后台 - 物料出库 Response VO") +@Data +@ExcelIgnoreUnannotated +public class MaterialInventoryOutRespVO { + + @Schema(description = "入库ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18713") + @ExcelProperty("入库ID") + private Long id; + + @Schema(description = "入库批次号", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("入库批次号") + private String inventoryOutNo; + + @Schema(description = "物料ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14541") + @ExcelProperty("物料ID") + private Long materialId; + + @Schema(description = "物料名称", example = "芋艿") + @ExcelProperty("物料名称") + private String materialName; + + @Schema(description = "物料类型ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "9209") + @ExcelProperty("物料类型ID") + private Long materialTypeId; + + @Schema(description = "耗材类型名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") + @ExcelProperty("耗材类型名称") + private String materialTypeName; + + @Schema(description = "类别ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12624") + @ExcelProperty("类别ID") + private Long typeId; + + @Schema(description = "类别名称:药品", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") + @ExcelProperty("类别名称:药品") + private String typeName; + + @Schema(description = "类别明细ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "24611") + @ExcelProperty("类别明细ID") + private Long typeDetailId; + + @Schema(description = "类别明细", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") + @ExcelProperty("类别明细") + private String typeDetailName; + + @Schema(description = "规格", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("规格") + private String specifications; + + @Schema(description = "归属单位ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "17128") + @ExcelProperty("归属单位ID") + private Long belongCompanyId; + + @Schema(description = "归属单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") + @ExcelProperty("归属单位") + private String belongCompanyName; + + @Schema(description = "出库数量", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("出库数量") + private Long outInventoryNum; + + @Schema(description = "单位ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1033") + @ExcelProperty("单位ID") + private Long unitId; + + @Schema(description = "单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") + @ExcelProperty("单位") + private String unitName; + + @Schema(description = "出库日期", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("出库日期") + private LocalDateTime outDate; + + @Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED, example = "你说的对") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "部门ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22618") + @ExcelProperty("部门ID") + private Long deptId; + + @Schema(description = "类型: 1:手动出库;2:养护类出库", example = "1") + @ExcelProperty("类型: 1:手动出库;2:养护类出库") + private Integer type; + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryout/vo/MaterialInventoryOutSaveReqVO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryout/vo/MaterialInventoryOutSaveReqVO.java new file mode 100644 index 0000000..a92e3f9 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryout/vo/MaterialInventoryOutSaveReqVO.java @@ -0,0 +1,32 @@ +package com.zteits.urbanops.module.garden.controller.admin.materialinventoryout.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 物料出库新增/修改 Request VO") +@Data +public class MaterialInventoryOutSaveReqVO { + + @Schema(description = "入库ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18713") + private Long id; + + @Schema(description = "物料ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14541") + @NotNull(message = "物料ID不能为空") + private Long materialId; + + @Schema(description = "物料名称", example = "芋艿") + private String materialName; + + @Schema(description = "出库数量", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "出库数量不能为空") + private Long outInventoryNum; + + @Schema(description = "出库日期", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "出库日期不能为空") + private LocalDateTime outDate; + +} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/MaterialTypeAdminController.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/MaterialTypeAdminController.java deleted file mode 100644 index e5d1df0..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/MaterialTypeAdminController.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.zteits.urbanops.module.garden.controller.admin.materialtype; - -import com.zteits.urbanops.framework.common.pojo.CommonResult; -import com.zteits.urbanops.framework.common.pojo.PageParam; -import com.zteits.urbanops.framework.common.pojo.PageResult; -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialTypeDO; -import com.zteits.urbanops.module.garden.dal.mysql.material.MaterialTypeMapper; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import jakarta.annotation.Resource; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; - -@Tag(name = "管理后台 - 物料类型") -@RestController -@RequestMapping("/materialType/type") -public class MaterialTypeAdminController { - - @Resource - private MaterialTypeMapper mapper; - - @GetMapping("/getMaterialBigTypeList") - @Operation(summary = "物料类型-大类列表") - @PreAuthorize("@ss.hasPermission('material:type:list')") - public CommonResult> getMaterialBigTypeList() { - return success(mapper.selectBigTypeList()); - } - - @PostMapping("/listForPage") - @Operation(summary = "物料类型-分页") - @PreAuthorize("@ss.hasPermission('material:type:list')") - public CommonResult> listForPage(@RequestBody MaterialTypeDO where, - @RequestParam(value = "pageNum", required = false) Integer pageNum, - @RequestParam(value = "pageSize", required = false) Integer pageSize) { - PageParam page = new PageParam(); - page.setPageNo(pageNum == null ? 1 : pageNum); - page.setPageSize(pageSize == null ? 10 : pageSize); - return success(mapper.selectPage(page, where)); - } -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/MaterialTypeController.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/MaterialTypeController.java new file mode 100644 index 0000000..ce919b9 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/MaterialTypeController.java @@ -0,0 +1,134 @@ +package com.zteits.urbanops.module.garden.controller.admin.materialtype; + +import com.zteits.urbanops.module.garden.controller.admin.materialtype.vo.MaterialTypePageReqVO; +import com.zteits.urbanops.module.garden.controller.admin.materialtype.vo.MaterialTypeRespVO; +import com.zteits.urbanops.module.garden.controller.admin.materialtype.vo.MaterialTypeSaveReqVO; +import com.zteits.urbanops.module.garden.dal.dataobject.materialtype.MaterialTypeDO; +import com.zteits.urbanops.module.garden.service.materialtype.MaterialTypeService; +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import jakarta.validation.*; +import jakarta.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.zteits.urbanops.framework.common.pojo.PageParam; +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.common.pojo.CommonResult; +import com.zteits.urbanops.framework.common.util.object.BeanUtils; +import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; + +import com.zteits.urbanops.framework.excel.core.util.ExcelUtils; + +import com.zteits.urbanops.framework.apilog.core.annotation.ApiAccessLog; +import static com.zteits.urbanops.framework.apilog.core.enums.OperateTypeEnum.*; + +@Tag(name = "管理后台 - 物料类型") +@RestController +@RequestMapping("/garden/material-type") +@Validated +public class MaterialTypeController { + + @Resource + private MaterialTypeService materialTypeService; + + @PostMapping("/create") + @Operation(summary = "创建物料类型") + @PreAuthorize("@ss.hasPermission('garden:material-type:create')") + public CommonResult createMaterialType(@Valid @RequestBody MaterialTypeSaveReqVO createReqVO) { + return success(materialTypeService.createMaterialType(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新物料类型") + @PreAuthorize("@ss.hasPermission('garden:material-type:update')") + public CommonResult updateMaterialType(@Valid @RequestBody MaterialTypeSaveReqVO updateReqVO) { + materialTypeService.updateMaterialType(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除物料类型") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('garden:material-type:delete')") + public CommonResult deleteMaterialType(@RequestParam("id") Long id) { + materialTypeService.deleteMaterialType(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除物料类型") + @PreAuthorize("@ss.hasPermission('garden:material-type:delete')") + public CommonResult deleteMaterialTypeList(@RequestParam("ids") List ids) { + materialTypeService.deleteMaterialTypeListByIds(ids); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得物料类型") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('garden:material-type:query')") + public CommonResult getMaterialType(@RequestParam("id") Long id) { + MaterialTypeDO materialType = materialTypeService.getMaterialType(id); + return success(BeanUtils.toBean(materialType, MaterialTypeRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得物料类型分页") + @PreAuthorize("@ss.hasPermission('garden:material-type:query')") + public CommonResult> getMaterialTypePage(@Valid MaterialTypePageReqVO pageReqVO) { + PageResult pageResult = materialTypeService.getMaterialTypePage(pageReqVO); + return success(BeanUtils.toBean(pageResult, MaterialTypeRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出物料类型 Excel") + @PreAuthorize("@ss.hasPermission('garden:material-type:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportMaterialTypeExcel(@Valid MaterialTypePageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = materialTypeService.getMaterialTypePage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "物料类型.xls", "数据", MaterialTypeRespVO.class, + BeanUtils.toBean(list, MaterialTypeRespVO.class)); + } + + + /** + * 获取物料类型详细信息 + */ + @Operation(summary ="物料类型基础表-耗材类型List") + @GetMapping(value = "/getMaterialBigTypeList") + @PreAuthorize("@ss.hasPermission('garden:material-type:query')") + public CommonResult getInfo() { + return success(materialTypeService.queryMaterialBigType(null)); + } + + /** + * 获取物料类型详细信息 + */ + @Operation(summary ="物料类型基础表-类别List") + @GetMapping(value = "/getMaterialMidTypeList") + @PreAuthorize("@ss.hasPermission('garden:material-type:query')") + public CommonResult getMaterialMidTypeList(@RequestParam("material_type_id") Long materialTypeId) { + return success(materialTypeService.queryMaterialMidType(materialTypeId)); + } + + /** + * 获取物料类型详细信息 + */ + @Operation(summary ="物料类型基础表-类别List") + @GetMapping(value = "/getMaterialDetailTypeList") + @PreAuthorize("@ss.hasPermission('garden:material-type:query')") + public CommonResult getMaterialDetailTypeList(@RequestParam("parent_type_id") Long parentTypeId) { + return success(materialTypeService.queryMaterialDetailType(parentTypeId)); + } +} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/MaterialTypeManagerController.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/MaterialTypeManagerController.java new file mode 100644 index 0000000..219f339 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/MaterialTypeManagerController.java @@ -0,0 +1,105 @@ +package com.zteits.urbanops.module.garden.controller.admin.materialtype; + +import com.zteits.urbanops.module.garden.controller.admin.materialtype.vo.MaterialTypeManagerPageReqVO; +import com.zteits.urbanops.module.garden.controller.admin.materialtype.vo.MaterialTypeManagerRespVO; +import com.zteits.urbanops.module.garden.controller.admin.materialtype.vo.MaterialTypeManagerSaveReqVO; +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import jakarta.validation.*; +import jakarta.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.zteits.urbanops.framework.common.pojo.PageParam; +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.common.pojo.CommonResult; +import com.zteits.urbanops.framework.common.util.object.BeanUtils; +import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; + +import com.zteits.urbanops.framework.excel.core.util.ExcelUtils; + +import com.zteits.urbanops.framework.apilog.core.annotation.ApiAccessLog; +import static com.zteits.urbanops.framework.apilog.core.enums.OperateTypeEnum.*; + +import com.zteits.urbanops.module.garden.dal.dataobject.materialtype.MaterialTypeManagerDO; +import com.zteits.urbanops.module.garden.service.materialtype.MaterialTypeManagerService; + +@Tag(name = "管理后台 - 耗材类别管理") +@RestController +@RequestMapping("/garden/material-type-manager") +@Validated +public class MaterialTypeManagerController { + + @Resource + private MaterialTypeManagerService materialTypeManagerService; + + @PostMapping("/create") + @Operation(summary = "创建耗材类别管理") + @PreAuthorize("@ss.hasPermission('garden:material-type-manager:create')") + public CommonResult createMaterialTypeManager(@Valid @RequestBody MaterialTypeManagerSaveReqVO createReqVO) { + return success(materialTypeManagerService.createMaterialTypeManager(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新耗材类别管理") + @PreAuthorize("@ss.hasPermission('garden:material-type-manager:update')") + public CommonResult updateMaterialTypeManager(@Valid @RequestBody MaterialTypeManagerSaveReqVO updateReqVO) { + materialTypeManagerService.updateMaterialTypeManager(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除耗材类别管理") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('garden:material-type-manager:delete')") + public CommonResult deleteMaterialTypeManager(@RequestParam("id") Long id) { + materialTypeManagerService.deleteMaterialTypeManager(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除耗材类别管理") + @PreAuthorize("@ss.hasPermission('garden:material-type-manager:delete')") + public CommonResult deleteMaterialTypeManagerList(@RequestParam("ids") List ids) { + materialTypeManagerService.deleteMaterialTypeManagerListByIds(ids); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得耗材类别管理") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('garden:material-type-manager:query')") + public CommonResult getMaterialTypeManager(@RequestParam("id") Long id) { + MaterialTypeManagerDO materialTypeManager = materialTypeManagerService.getMaterialTypeManager(id); + return success(BeanUtils.toBean(materialTypeManager, MaterialTypeManagerRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得耗材类别管理分页") + @PreAuthorize("@ss.hasPermission('garden:material-type-manager:query')") + public CommonResult> getMaterialTypeManagerPage(@Valid MaterialTypeManagerPageReqVO pageReqVO) { + PageResult pageResult = materialTypeManagerService.getMaterialTypeManagerPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, MaterialTypeManagerRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出耗材类别管理 Excel") + @PreAuthorize("@ss.hasPermission('garden:material-type-manager:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportMaterialTypeManagerExcel(@Valid MaterialTypeManagerPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = materialTypeManagerService.getMaterialTypeManagerPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "耗材类别管理.xls", "数据", MaterialTypeManagerRespVO.class, + BeanUtils.toBean(list, MaterialTypeManagerRespVO.class)); + } + +} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypeManagerPageReqVO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypeManagerPageReqVO.java new file mode 100644 index 0000000..1ae07f2 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypeManagerPageReqVO.java @@ -0,0 +1,65 @@ +package com.zteits.urbanops.module.garden.controller.admin.materialtype.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zteits.urbanops.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 耗材类别管理分页 Request VO") +@Data +public class MaterialTypeManagerPageReqVO extends PageParam { + + @Schema(description = "种类ID", example = "1958") + private Long classifyId; + + @Schema(description = "种类名称", example = "芋艿") + private String classifyName; + + @Schema(description = "类别ID", example = "22418") + private Long typeId; + + @Schema(description = "类别名称", example = "王五") + private String typeName; + + @Schema(description = "类别明细ID", example = "22381") + private Long typeDetailId; + + @Schema(description = "类别明细名称", example = "芋艿") + private String typeDetailName; + + @Schema(description = "公司ID", example = "22461") + private Long companyId; + + @Schema(description = "公司名称", example = "李四") + private String companyName; + + @Schema(description = "数量") + private Long num; + + @Schema(description = "单位ID", example = "26719") + private Long unitId; + + @Schema(description = "单位", example = "张三") + private String unitName; + + @Schema(description = " 描述", example = "你说的对") + private String remark; + + @Schema(description = "状态(0正常 1停用)", example = "1") + private Integer status; + + @Schema(description = "创建者") + private String creator; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "更新者") + private String updater; + +} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypeManagerRespVO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypeManagerRespVO.java new file mode 100644 index 0000000..39b6db0 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypeManagerRespVO.java @@ -0,0 +1,83 @@ +package com.zteits.urbanops.module.garden.controller.admin.materialtype.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import cn.idev.excel.annotation.*; + +@Schema(description = "管理后台 - 耗材类别管理 Response VO") +@Data +@ExcelIgnoreUnannotated +public class MaterialTypeManagerRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22778") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "种类ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1958") + @ExcelProperty("种类ID") + private Long classifyId; + + @Schema(description = "种类名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") + @ExcelProperty("种类名称") + private String classifyName; + + @Schema(description = "类别ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22418") + @ExcelProperty("类别ID") + private Long typeId; + + @Schema(description = "类别名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") + @ExcelProperty("类别名称") + private String typeName; + + @Schema(description = "类别明细ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22381") + @ExcelProperty("类别明细ID") + private Long typeDetailId; + + @Schema(description = "类别明细名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") + @ExcelProperty("类别明细名称") + private String typeDetailName; + + @Schema(description = "公司ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22461") + @ExcelProperty("公司ID") + private Long companyId; + + @Schema(description = "公司名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") + @ExcelProperty("公司名称") + private String companyName; + + @Schema(description = "数量", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("数量") + private Long num; + + @Schema(description = "单位ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "26719") + @ExcelProperty("单位ID") + private Long unitId; + + @Schema(description = "单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") + @ExcelProperty("单位") + private String unitName; + + @Schema(description = " 描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "你说的对") + @ExcelProperty(" 描述") + private String remark; + + @Schema(description = "状态(0正常 1停用)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @ExcelProperty("状态(0正常 1停用)") + private Integer status; + + @Schema(description = "创建者") + @ExcelProperty("创建者") + private String creator; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "更新者") + @ExcelProperty("更新者") + private String updater; + +} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypeManagerSaveReqVO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypeManagerSaveReqVO.java new file mode 100644 index 0000000..da78e5a --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypeManagerSaveReqVO.java @@ -0,0 +1,73 @@ +package com.zteits.urbanops.module.garden.controller.admin.materialtype.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; + +@Schema(description = "管理后台 - 耗材类别管理新增/修改 Request VO") +@Data +public class MaterialTypeManagerSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22778") + private Long id; + + @Schema(description = "种类ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1958") + @NotNull(message = "种类ID不能为空") + private Long classifyId; + + @Schema(description = "种类名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") + @NotEmpty(message = "种类名称不能为空") + private String classifyName; + + @Schema(description = "类别ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22418") + @NotNull(message = "类别ID不能为空") + private Long typeId; + + @Schema(description = "类别名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") + @NotEmpty(message = "类别名称不能为空") + private String typeName; + + @Schema(description = "类别明细ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22381") + @NotNull(message = "类别明细ID不能为空") + private Long typeDetailId; + + @Schema(description = "类别明细名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") + @NotEmpty(message = "类别明细名称不能为空") + private String typeDetailName; + + @Schema(description = "公司ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22461") + @NotNull(message = "公司ID不能为空") + private Long companyId; + + @Schema(description = "公司名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") + @NotEmpty(message = "公司名称不能为空") + private String companyName; + + @Schema(description = "数量", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "数量不能为空") + private Long num; + + @Schema(description = "单位ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "26719") + @NotNull(message = "单位ID不能为空") + private Long unitId; + + @Schema(description = "单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") + @NotEmpty(message = "单位不能为空") + private String unitName; + + @Schema(description = " 描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "你说的对") + @NotEmpty(message = " 描述不能为空") + private String remark; + + @Schema(description = "状态(0正常 1停用)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @NotNull(message = "状态(0正常 1停用)不能为空") + private Integer status; + + @Schema(description = "创建者") + private String creator; + + @Schema(description = "更新者") + private String updater; + +} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypePageReqVO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypePageReqVO.java new file mode 100644 index 0000000..9dd1539 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypePageReqVO.java @@ -0,0 +1,56 @@ +package com.zteits.urbanops.module.garden.controller.admin.materialtype.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zteits.urbanops.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 物料类型分页 Request VO") +@Data +public class MaterialTypePageReqVO extends PageParam { + + @Schema(description = "物料类型ID", example = "31914") + private Long materialTypeId; + + @Schema(description = "耗材类型名称:工具", example = "赵六") + private String materialTypeName; + + @Schema(description = "类别ID", example = "13166") + private Long typeId; + + @Schema(description = "类别名称:药品", example = "李四") + private String typeName; + + @Schema(description = "付物料类型ID", example = "4908") + private Long materialParentTypeId; + + @Schema(description = "类别明细ID", example = "2459") + private Long typeDetailId; + + @Schema(description = "类别明细", example = "赵六") + private String typeDetailName; + + @Schema(description = "父类别ID", example = "6341") + private Long parentTypeId; + + @Schema(description = "备注", example = "你猜") + private String remark; + + @Schema(description = "状态(0正常 1停用)", example = "2") + private String status; + + @Schema(description = "创建者") + private String creator; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "更新者") + private String updater; + +} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypeResp.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypeResp.java new file mode 100644 index 0000000..7774c43 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypeResp.java @@ -0,0 +1,38 @@ +package com.zteits.urbanops.module.garden.controller.admin.materialtype.vo; + +/** + * Copyright: Copyright (c) 2017 zteits + * + * @ClassName: MaterialTypeManagerResp.java + * @Description: + * @version: v1.0.0 + * @author: wangfs + * @date: 2024-11-10 13:50 + * Modification History: + * Date Author Version Description + * ---------------------------------------------------------* + * 2024-11-10 wangfs v1.0.0 创建 + */ + +public class MaterialTypeResp { + + private Long value; + + private String label; + + public Long getValue() { + return value; + } + + public void setValue(Long value) { + this.value = value; + } + + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } +} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypeRespVO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypeRespVO.java new file mode 100644 index 0000000..a47d98f --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypeRespVO.java @@ -0,0 +1,71 @@ +package com.zteits.urbanops.module.garden.controller.admin.materialtype.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import cn.idev.excel.annotation.*; + +@Schema(description = "管理后台 - 物料类型 Response VO") +@Data +@ExcelIgnoreUnannotated +public class MaterialTypeRespVO { + + @Schema(description = "物料ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23621") + @ExcelProperty("物料ID") + private Long id; + + @Schema(description = "物料类型ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "31914") + @ExcelProperty("物料类型ID") + private Long materialTypeId; + + @Schema(description = "耗材类型名称:工具", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") + @ExcelProperty("耗材类型名称:工具") + private String materialTypeName; + + @Schema(description = "类别ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "13166") + @ExcelProperty("类别ID") + private Long typeId; + + @Schema(description = "类别名称:药品", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") + @ExcelProperty("类别名称:药品") + private String typeName; + + @Schema(description = "付物料类型ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4908") + @ExcelProperty("付物料类型ID") + private Long materialParentTypeId; + + @Schema(description = "类别明细ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2459") + @ExcelProperty("类别明细ID") + private Long typeDetailId; + + @Schema(description = "类别明细", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") + @ExcelProperty("类别明细") + private String typeDetailName; + + @Schema(description = "父类别ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6341") + @ExcelProperty("父类别ID") + private Long parentTypeId; + + @Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED, example = "你猜") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "状态(0正常 1停用)", example = "2") + @ExcelProperty("状态(0正常 1停用)") + private String status; + + @Schema(description = "创建者") + @ExcelProperty("创建者") + private String creator; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "更新者") + @ExcelProperty("更新者") + private String updater; + +} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypeSaveReqVO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypeSaveReqVO.java new file mode 100644 index 0000000..c50fc07 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypeSaveReqVO.java @@ -0,0 +1,47 @@ +package com.zteits.urbanops.module.garden.controller.admin.materialtype.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; + +@Schema(description = "管理后台 - 物料类型新增/修改 Request VO") +@Data +public class MaterialTypeSaveReqVO { + + @Schema(description = "物料ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23621") + private Long id; + + @Schema(description = "物料类型ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "31914") + @NotNull(message = "物料类型ID不能为空") + private Long materialTypeId; + + @Schema(description = "耗材类型名称:工具", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") + @NotEmpty(message = "耗材类型名称:工具不能为空") + private String materialTypeName; + + @Schema(description = "类别ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "13166") + @NotNull(message = "类别ID不能为空") + private Long typeId; + + @Schema(description = "类别名称:药品", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") + @NotEmpty(message = "类别名称:药品不能为空") + private String typeName; + + @Schema(description = "付物料类型ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4908") + private Long materialParentTypeId; + + @Schema(description = "类别明细ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2459") + private Long typeDetailId; + + @Schema(description = "类别明细", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") + @NotEmpty(message = "类别明细不能为空") + private String typeDetailName; + + @Schema(description = "父类别ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6341") + private Long parentTypeId; + + @Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED, example = "你猜") + private String remark; + +} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/road/RoadController.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/road/RoadController.java new file mode 100644 index 0000000..f158202 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/road/RoadController.java @@ -0,0 +1,104 @@ +package com.zteits.urbanops.module.garden.controller.admin.road; + +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import jakarta.validation.constraints.*; +import jakarta.validation.*; +import jakarta.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.zteits.urbanops.framework.common.pojo.PageParam; +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.common.pojo.CommonResult; +import com.zteits.urbanops.framework.common.util.object.BeanUtils; +import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; + +import com.zteits.urbanops.framework.excel.core.util.ExcelUtils; + +import com.zteits.urbanops.framework.apilog.core.annotation.ApiAccessLog; +import static com.zteits.urbanops.framework.apilog.core.enums.OperateTypeEnum.*; + +import com.zteits.urbanops.module.garden.controller.admin.road.vo.*; +import com.zteits.urbanops.module.garden.dal.dataobject.road.RoadDO; +import com.zteits.urbanops.module.garden.service.road.RoadService; + +@Tag(name = "管理后台 - 道路管理") +@RestController +@RequestMapping("/garden/road") +@Validated +public class RoadController { + + @Resource + private RoadService roadService; + + @PostMapping("/create") + @Operation(summary = "创建道路管理") + @PreAuthorize("@ss.hasPermission('garden:road:create')") + public CommonResult createRoad(@Valid @RequestBody RoadSaveReqVO createReqVO) { + return success(roadService.createRoad(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新道路管理") + @PreAuthorize("@ss.hasPermission('garden:road:update')") + public CommonResult updateRoad(@Valid @RequestBody RoadSaveReqVO updateReqVO) { + roadService.updateRoad(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除道路管理") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('garden:road:delete')") + public CommonResult deleteRoad(@RequestParam("id") Long id) { + roadService.deleteRoad(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除道路管理") + @PreAuthorize("@ss.hasPermission('garden:road:delete')") + public CommonResult deleteRoadList(@RequestParam("ids") List ids) { + roadService.deleteRoadListByIds(ids); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得道路管理") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('garden:road:query')") + public CommonResult getRoad(@RequestParam("id") Long id) { + RoadDO road = roadService.getRoad(id); + return success(BeanUtils.toBean(road, RoadRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得道路管理分页") + @PreAuthorize("@ss.hasPermission('garden:road:query')") + public CommonResult> getRoadPage(@Valid RoadPageReqVO pageReqVO) { + PageResult pageResult = roadService.getRoadPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, RoadRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出道路管理 Excel") + @PreAuthorize("@ss.hasPermission('garden:road:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportRoadExcel(@Valid RoadPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = roadService.getRoadPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "道路管理.xls", "数据", RoadRespVO.class, + BeanUtils.toBean(list, RoadRespVO.class)); + } + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/road/vo/RoadPageReqVO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/road/vo/RoadPageReqVO.java new file mode 100644 index 0000000..10d3f00 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/road/vo/RoadPageReqVO.java @@ -0,0 +1,77 @@ +package com.zteits.urbanops.module.garden.controller.admin.road.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zteits.urbanops.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 道路管理分页 Request VO") +@Data +public class RoadPageReqVO extends PageParam { + + @Schema(description = "道路名称", example = "赵六") + private String roadName; + + @Schema(description = "街道ID", example = "30480") + private String streetId; + + @Schema(description = "街道名称", example = "赵六") + private String streetName; + + @Schema(description = "养护级别: 10:特级;11:一级:12:二级;13:三级", example = "26337") + private Integer levelId; + + @Schema(description = "行道树绿化面积") + private String greenBeltTreeArea; + + @Schema(description = "绿化带面积") + private String greenBeltArea; + + @Schema(description = "总绿化带面积") + private String totalArea; + + @Schema(description = "行道树(棵)面积") + private String treeArea; + + @Schema(description = "起点经度") + private String startingLatitude; + + @Schema(description = "起点维度") + private String startingLongitude; + + @Schema(description = "起点描述", example = "你猜") + private String startingRemark; + + @Schema(description = "终点经度") + private String endLatitude; + + @Schema(description = "终点维度") + private String endLongitude; + + @Schema(description = "终点描述", example = "你猜") + private String endRemark; + + @Schema(description = "备注", example = "你猜") + private String remark; + + @Schema(description = "归属(一级部门id)", example = "2323") + private Long companyId; + + @Schema(description = "部门ID(道路负责部门id)", example = "13872") + private Long deptId; + + @Schema(description = "创建者", example = "赵六") + private String creatorName; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "更新者", example = "芋艿") + private String updaterName; + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/road/vo/RoadRespVO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/road/vo/RoadRespVO.java new file mode 100644 index 0000000..fb2167d --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/road/vo/RoadRespVO.java @@ -0,0 +1,99 @@ +package com.zteits.urbanops.module.garden.controller.admin.road.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import cn.idev.excel.annotation.*; + +@Schema(description = "管理后台 - 道路管理 Response VO") +@Data +@ExcelIgnoreUnannotated +public class RoadRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15456") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "道路名称", example = "赵六") + @ExcelProperty("道路名称") + private String roadName; + + @Schema(description = "街道ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "30480") + @ExcelProperty("街道ID") + private String streetId; + + @Schema(description = "街道名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") + @ExcelProperty("街道名称") + private String streetName; + + @Schema(description = "养护级别: 10:特级;11:一级:12:二级;13:三级", requiredMode = Schema.RequiredMode.REQUIRED, example = "26337") + @ExcelProperty("养护级别: 10:特级;11:一级:12:二级;13:三级") + private Integer levelId; + + @Schema(description = "行道树绿化面积", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("行道树绿化面积") + private String greenBeltTreeArea; + + @Schema(description = "绿化带面积", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("绿化带面积") + private String greenBeltArea; + + @Schema(description = "总绿化带面积", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("总绿化带面积") + private String totalArea; + + @Schema(description = "行道树(棵)面积", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("行道树(棵)面积") + private String treeArea; + + @Schema(description = "起点经度", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("起点经度") + private String startingLatitude; + + @Schema(description = "起点维度", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("起点维度") + private String startingLongitude; + + @Schema(description = "起点描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "你猜") + @ExcelProperty("起点描述") + private String startingRemark; + + @Schema(description = "终点经度", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("终点经度") + private String endLatitude; + + @Schema(description = "终点维度", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("终点维度") + private String endLongitude; + + @Schema(description = "终点描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "你猜") + @ExcelProperty("终点描述") + private String endRemark; + + @Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED, example = "你猜") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "归属(一级部门id)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2323") + @ExcelProperty("归属(一级部门id)") + private Long companyId; + + @Schema(description = "部门ID(道路负责部门id)", requiredMode = Schema.RequiredMode.REQUIRED, example = "13872") + @ExcelProperty("部门ID(道路负责部门id)") + private Long deptId; + + @Schema(description = "创建者", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") + @ExcelProperty("创建者") + private String creatorName; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "更新者", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") + @ExcelProperty("更新者") + private String updaterName; + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/road/vo/RoadSaveReqVO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/road/vo/RoadSaveReqVO.java new file mode 100644 index 0000000..c867d9d --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/road/vo/RoadSaveReqVO.java @@ -0,0 +1,90 @@ +package com.zteits.urbanops.module.garden.controller.admin.road.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; + +@Schema(description = "管理后台 - 道路管理新增/修改 Request VO") +@Data +public class RoadSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15456") + private Long id; + + @Schema(description = "道路名称", example = "赵六") + private String roadName; + + @Schema(description = "街道ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "30480") + @NotEmpty(message = "街道ID不能为空") + private String streetId; + + @Schema(description = "街道名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") + @NotEmpty(message = "街道名称不能为空") + private String streetName; + + @Schema(description = "养护级别: 10:特级;11:一级:12:二级;13:三级", requiredMode = Schema.RequiredMode.REQUIRED, example = "26337") + @NotNull(message = "养护级别: 10:特级;11:一级:12:二级;13:三级不能为空") + private Integer levelId; + + @Schema(description = "行道树绿化面积", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "行道树绿化面积不能为空") + private String greenBeltTreeArea; + + @Schema(description = "绿化带面积", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "绿化带面积不能为空") + private String greenBeltArea; + + @Schema(description = "总绿化带面积", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "总绿化带面积不能为空") + private String totalArea; + + @Schema(description = "行道树(棵)面积", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "行道树(棵)面积不能为空") + private String treeArea; + + @Schema(description = "起点经度", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "起点经度不能为空") + private String startingLatitude; + + @Schema(description = "起点维度", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "起点维度不能为空") + private String startingLongitude; + + @Schema(description = "起点描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "你猜") + @NotEmpty(message = "起点描述不能为空") + private String startingRemark; + + @Schema(description = "终点经度", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "终点经度不能为空") + private String endLatitude; + + @Schema(description = "终点维度", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "终点维度不能为空") + private String endLongitude; + + @Schema(description = "终点描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "你猜") + @NotEmpty(message = "终点描述不能为空") + private String endRemark; + + @Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED, example = "你猜") + @NotEmpty(message = "备注不能为空") + private String remark; + + @Schema(description = "归属(一级部门id)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2323") + @NotNull(message = "归属(一级部门id)不能为空") + private Long companyId; + + @Schema(description = "部门ID(道路负责部门id)", requiredMode = Schema.RequiredMode.REQUIRED, example = "13872") + @NotNull(message = "部门ID(道路负责部门id)不能为空") + private Long deptId; + + @Schema(description = "创建者", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") + @NotEmpty(message = "创建者不能为空") + private String creatorName; + + @Schema(description = "更新者", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") + @NotEmpty(message = "更新者不能为空") + private String updaterName; + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/roadmanager/RoadManagerController.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/roadmanager/RoadManagerController.java deleted file mode 100644 index 138eba9..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/roadmanager/RoadManagerController.java +++ /dev/null @@ -1,103 +0,0 @@ -package com.zteits.urbanops.module.garden.controller.admin.roadmanager; - -import com.zteits.urbanops.framework.common.pojo.CommonResult; -import com.zteits.urbanops.framework.common.pojo.PageResult; -import com.zteits.urbanops.framework.excel.core.util.ExcelUtils; -import com.zteits.urbanops.framework.common.util.object.BeanUtils; -import com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils; -import com.zteits.urbanops.module.garden.controller.admin.roadmanager.vo.RoadManagerPageReqVO; -import com.zteits.urbanops.module.garden.controller.admin.roadmanager.vo.RoadManagerSaveReqVO; -import com.zteits.urbanops.module.garden.dal.dataobject.road.RoadManagerDO; -import com.zteits.urbanops.module.garden.service.road.RoadManagerService; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; -import jakarta.annotation.Resource; -import jakarta.servlet.http.HttpServletResponse; -import jakarta.validation.Valid; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import java.io.IOException; -import java.util.List; - -import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; -import static com.zteits.urbanops.framework.apilog.core.enums.OperateTypeEnum.EXPORT; -import com.zteits.urbanops.framework.apilog.core.annotation.ApiAccessLog; - -@Tag(name = "管理后台 - 道路数据管理") -@RestController -@RequestMapping("/road/manager") -public class RoadManagerController { - - @Resource - private RoadManagerService roadManagerService; - - @PostMapping("/listForPage") - @Operation(summary = "道路数据管理-分页") - @PreAuthorize("@ss.hasPermission('garden:road-manager:query')") - public CommonResult> listForPage(@Valid @RequestBody RoadManagerPageReqVO reqVO) { - return success(roadManagerService.selectPage(reqVO)); - } - - @GetMapping("/export") - @Operation(summary = "道路数据管理-导出") - @PreAuthorize("@ss.hasPermission('garden:road-manager:export')") - @ApiAccessLog(operateType = EXPORT) - public void exportExcel(RoadManagerPageReqVO reqVO, HttpServletResponse response) throws IOException { - List list = roadManagerService.selectPage(reqVO).getList(); - ExcelUtils.write(response, "道路数据.xls", "数据", RoadManagerDO.class, - BeanUtils.toBean(list, RoadManagerDO.class)); - } - - @GetMapping("/getById") - @Operation(summary = "道路数据管理-详情") - @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('garden:road-manager:query')") - public CommonResult getById(@RequestParam("id") Long id) { - return success(roadManagerService.selectById(id)); - } - - @PostMapping("/add") - @Operation(summary = "道路数据管理-添加") - @PreAuthorize("@ss.hasPermission('garden:road-manager:create')") - public CommonResult add(@Valid @RequestBody RoadManagerSaveReqVO reqVO) { - RoadManagerDO entity = BeanUtils.toBean(reqVO, RoadManagerDO.class); - entity.setStatus(0); - return success(roadManagerService.insert(entity)); - } - - @PostMapping("/edit") - @Operation(summary = "道路数据管理-修改") - @PreAuthorize("@ss.hasPermission('garden:road-manager:update')") - public CommonResult edit(@Valid @RequestBody RoadManagerSaveReqVO reqVO) { - RoadManagerDO entity = BeanUtils.toBean(reqVO, RoadManagerDO.class); - entity.setStatus(0); - return success(roadManagerService.update(entity)); - } - - @GetMapping("/deleteById") - @Operation(summary = "道路数据管理-删除") - @PreAuthorize("@ss.hasPermission('garden:road-manager:delete')") - public CommonResult deleteById(@RequestParam("id") Long id) { - return success(roadManagerService.deleteById(id)); - } - - @GetMapping("/list") - @Operation(summary = "道路数据管理-列表") - @PreAuthorize("@ss.hasPermission('garden:road-manager:query')") - public CommonResult> list(@RequestParam(value = "company_id", required = false) Long companyId) { - RoadManagerDO where = new RoadManagerDO(); - where.setCompanyId(companyId); - return success(roadManagerService.selectList(where)); - } - - @GetMapping("/tree") - @Operation(summary = "道路数据管理-树") - @PreAuthorize("@ss.hasPermission('garden:road-manager:query')") - public CommonResult> tree(@RequestParam(value = "company_id", required = false) Long companyId) { - RoadManagerDO where = new RoadManagerDO(); - where.setCompanyId(companyId); - return success(roadManagerService.selectList(where)); - } -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/roadmanager/vo/RoadManagerPageReqVO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/roadmanager/vo/RoadManagerPageReqVO.java deleted file mode 100644 index 465dcd2..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/roadmanager/vo/RoadManagerPageReqVO.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.zteits.urbanops.module.garden.controller.admin.roadmanager.vo; - -import com.zteits.urbanops.framework.common.pojo.PageParam; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class RoadManagerPageReqVO extends PageParam { - @Schema(description = "道路名称") - private String roadName; - @Schema(description = "街道ID") - private String streetId; - @Schema(description = "街道名称") - private String streetName; - @Schema(description = "养护级别ID") - private Integer curingLevelId; - @Schema(description = "养护级别") - private String curingLevelName; - @Schema(description = "公司ID") - private Long companyId; - @Schema(description = "部门ID") - private Long deptId; - @Schema(description = "状态") - private Integer status; -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/roadmanager/vo/RoadManagerSaveReqVO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/roadmanager/vo/RoadManagerSaveReqVO.java deleted file mode 100644 index 01faa64..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/roadmanager/vo/RoadManagerSaveReqVO.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.zteits.urbanops.module.garden.controller.admin.roadmanager.vo; - -import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.constraints.NotEmpty; -import jakarta.validation.constraints.NotNull; -import lombok.Data; - -@Data -public class RoadManagerSaveReqVO { - private Long id; - @NotEmpty - @Schema(description = "道路名称") - private String roadName; - private String streetId; - private String streetName; - private Integer curingLevelId; - private String curingLevelName; - private String greenBeltTreeArea; - private String greenBeltArea; - private String totalArea; - private String treeArea; - private String startingLatitude; - private String startingLongitude; - private String startingRemark; - private String endLatitude; - private String endLongitude; - private String endRemark; - private Integer status; - private Long companyId; - private String companyName; - private Long deptId; - private String roadAttr; - private String direction; -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/standingbook/StandingBookController.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/standingbook/StandingBookController.java deleted file mode 100644 index 5712b09..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/standingbook/StandingBookController.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.zteits.urbanops.module.garden.controller.admin.standingbook; - -import com.zteits.urbanops.framework.common.pojo.CommonResult; -import com.zteits.urbanops.framework.common.pojo.PageParam; -import com.zteits.urbanops.framework.common.pojo.PageResult; -import com.zteits.urbanops.module.garden.controller.admin.standingbook.vo.StandingBookPageReqVO; -import com.zteits.urbanops.module.garden.dal.dataobject.standingbook.StandingBookDO; -import com.zteits.urbanops.module.garden.service.standingbook.StandingBookService; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import jakarta.annotation.Resource; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; - -@Tag(name = "管理后台 - 年度基础台账") -@RestController -@RequestMapping("/standing/book") -public class StandingBookController { - - @Resource - private StandingBookService standingBookService; - - @PostMapping("/listForPage") - @Operation(summary = "年度基础台账-分页") - public CommonResult> listForPage(@RequestBody StandingBookPageReqVO reqVO) { - PageParam page = new PageParam(); - page.setPageNo(reqVO.getPageNo()); - page.setPageSize(reqVO.getPageSize()); - return success(standingBookService.selectPage(page, reqVO)); - } -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/standingbook/vo/StandingBookPageReqVO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/standingbook/vo/StandingBookPageReqVO.java deleted file mode 100644 index 774d8ea..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/standingbook/vo/StandingBookPageReqVO.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.zteits.urbanops.module.garden.controller.admin.standingbook.vo; - -import com.zteits.urbanops.framework.common.pojo.PageParam; -import lombok.Data; - -@Data -public class StandingBookPageReqVO extends PageParam { - private String standingBookYear; -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/app/AppMaterialTypeController.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/app/AppMaterialTypeController.java deleted file mode 100644 index 649472f..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/app/AppMaterialTypeController.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.zteits.urbanops.module.garden.controller.app; - -import com.zteits.urbanops.framework.common.pojo.CommonResult; -import com.zteits.urbanops.module.garden.controller.business.vo.MaterialTypeManagerRespVO; -import com.zteits.urbanops.module.garden.service.material.MaterialTypeService; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import jakarta.annotation.Resource; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import java.util.List; - -import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; - -@Tag(name = "APP - 物料类型") -@RestController -@RequestMapping("/app/materialType/type") -public class AppMaterialTypeController { - - @Resource - private MaterialTypeService materialTypeService; - - @GetMapping("/getMaterialBigTypeList") - @Operation(summary = "物料类型基础表-耗材类型List") - public CommonResult> getMaterialBigTypeList() { - return success(materialTypeService.queryMaterialBigType(30000L)); - } - - @GetMapping("/getMaterialMidTypeList") - @Operation(summary = "物料类型基础表-类别List") - public CommonResult> getMaterialMidTypeList(@RequestParam("material_type_id") Long materialTypeId) { - return success(materialTypeService.queryMaterialMidType(materialTypeId)); - } - - @GetMapping("/getMaterialDetailTypeList") - @Operation(summary = "物料类型基础表-类别明细List") - public CommonResult> getMaterialDetailTypeList(@RequestParam("parent_type_id") Long parentTypeId) { - return success(materialTypeService.queryMaterialDetailType(parentTypeId)); - } -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/business/MaterialTypeController.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/business/MaterialTypeController.java deleted file mode 100644 index fc4624c..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/business/MaterialTypeController.java +++ /dev/null @@ -1,91 +0,0 @@ -package com.zteits.urbanops.module.garden.controller.business; - -import cn.hutool.core.bean.BeanUtil; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.zteits.urbanops.framework.common.pojo.CommonResult; -import com.zteits.urbanops.framework.common.pojo.PageResult; -import com.zteits.urbanops.module.garden.controller.business.vo.MaterialTypeAddReqVO; -import com.zteits.urbanops.module.garden.controller.business.vo.MaterialTypeEditReqVO; -import com.zteits.urbanops.module.garden.controller.business.vo.MaterialTypeManagerRespVO; -import com.zteits.urbanops.module.garden.controller.business.vo.MaterialTypePageReqVO; -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialTypeDO; -import com.zteits.urbanops.module.garden.service.material.MaterialTypeService; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import jakarta.annotation.Resource; -import jakarta.validation.Valid; -import org.springframework.web.bind.annotation.*; - -import java.time.LocalDateTime; -import java.util.List; - -import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; - -@Tag(name = "园林养护 - 物料类型") -@RestController -@RequestMapping("/materialType/type") -public class MaterialTypeController { - - @Resource - private MaterialTypeService materialTypeService; - - @GetMapping("/getMaterialBigTypeList") - @Operation(summary = "物料类型基础表-耗材类型List") - public CommonResult> getMaterialBigTypeList() { - return success(materialTypeService.queryMaterialBigType(null)); - } - - @GetMapping("/getMaterialMidTypeList") - @Operation(summary = "物料类型基础表-类别List") - public CommonResult> getMaterialMidTypeList(@RequestParam("material_type_id") Long materialTypeId) { - return success(materialTypeService.queryMaterialMidType(materialTypeId)); - } - - @GetMapping("/getMaterialDetailTypeList") - @Operation(summary = "物料类型基础表-类别明细List") - public CommonResult> getMaterialDetailTypeList(@RequestParam("parent_type_id") Long parentTypeId) { - return success(materialTypeService.queryMaterialDetailType(parentTypeId)); - } - - @PostMapping("/listForPage") - @Operation(summary = "耗材基础-分页") - public CommonResult> listForPage(@Valid @RequestBody MaterialTypePageReqVO reqVO) { - MaterialTypeDO where = new MaterialTypeDO(); - String keyword = reqVO.getTypeName(); - if (keyword == null || keyword.isEmpty()) { - keyword = reqVO.getMaterialTypeName(); - } - if (keyword == null || keyword.isEmpty()) { - keyword = reqVO.getTypeDetailName(); - } - where.setTypeName(keyword); - Page page = materialTypeService.selectPage(new Page<>(reqVO.getPageNum(), reqVO.getPageSize()), where); - return success(new PageResult<>(page.getRecords(), page.getTotal())); - } - - @PostMapping("/add") - @Operation(summary = "耗材基础-添加") - public CommonResult add(@Valid @RequestBody MaterialTypeAddReqVO reqVO) { - MaterialTypeDO entity = new MaterialTypeDO(); - entity.setTypeName(reqVO.getTypeDetailName()); - entity.setParentId(reqVO.getTypeId()); - entity.setLevel(3); - entity.setCreator("system"); - entity.setUpdater("system"); - return success(materialTypeService.insert(entity)); - } - - @PostMapping("/edit") - @Operation(summary = "耗材基础-修改") - public CommonResult edit(@Valid @RequestBody MaterialTypeEditReqVO reqVO) { - MaterialTypeDO entity = new MaterialTypeDO(); - BeanUtil.copyProperties(reqVO, entity, true); - return success(materialTypeService.update(entity)); - } - - @GetMapping("/deleteById") - @Operation(summary = "耗材基础-删除") - public CommonResult deleteById(@RequestParam("id") Long id) { - return success(materialTypeService.deleteById(id)); - } -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/business/vo/MaterialTypeAddReqVO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/business/vo/MaterialTypeAddReqVO.java deleted file mode 100644 index 81c3f38..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/business/vo/MaterialTypeAddReqVO.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.zteits.urbanops.module.garden.controller.business.vo; - -import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.constraints.NotEmpty; -import jakarta.validation.constraints.NotNull; -import lombok.Data; - -@Data -public class MaterialTypeAddReqVO { - @Schema(description = "物料类型ID") - @NotNull - private Long materialTypeId; - - @Schema(description = "耗材类型名称") - @NotEmpty - private String materialTypeName; - - @Schema(description = "类别ID") - @NotNull - private Long typeId; - - @Schema(description = "类别名称") - @NotEmpty - private String typeName; - - @Schema(description = "类别明细") - @NotEmpty - private String typeDetailName; -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/business/vo/MaterialTypeEditReqVO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/business/vo/MaterialTypeEditReqVO.java deleted file mode 100644 index efc0e4e..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/business/vo/MaterialTypeEditReqVO.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.zteits.urbanops.module.garden.controller.business.vo; - -import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.constraints.NotNull; -import lombok.Data; - -@Data -public class MaterialTypeEditReqVO { - @NotNull - private Long id; - - @Schema(description = "物料类型ID") - private Long materialTypeId; - - @Schema(description = "耗材类型名称") - private String materialTypeName; - - @Schema(description = "类别ID") - private Long typeId; - - @Schema(description = "类别名称") - private String typeName; - - @Schema(description = "类别明细ID") - private Long typeDetailId; - - @Schema(description = "类别明细") - private String typeDetailName; - - private Long materialParentTypeId; - - private Long parentTypeId; - - private String status; - - private String remark; -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/business/vo/MaterialTypeManagerRespVO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/business/vo/MaterialTypeManagerRespVO.java deleted file mode 100644 index 0f46453..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/business/vo/MaterialTypeManagerRespVO.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.zteits.urbanops.module.garden.controller.business.vo; - -import lombok.Data; - -@Data -public class MaterialTypeManagerRespVO { - private Long value; - private String label; - private Long materialParentTypeId; - private Long parentTypeId; -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/business/vo/MaterialTypePageReqVO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/business/vo/MaterialTypePageReqVO.java deleted file mode 100644 index 2e17e00..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/business/vo/MaterialTypePageReqVO.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.zteits.urbanops.module.garden.controller.business.vo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class MaterialTypePageReqVO { - - @Schema(description = "页码") - private Integer pageNum = 1; - - @Schema(description = "每页数量") - private Integer pageSize = 10; - - private String materialTypeName; - private String typeName; - private String typeDetailName; -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/hotline/HotlineCaseDO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/hotline/HotlineCaseDO.java deleted file mode 100644 index bade320..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/hotline/HotlineCaseDO.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.zteits.urbanops.module.garden.dal.dataobject.hotline; - -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import com.fasterxml.jackson.annotation.JsonFormat; -import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO; -import lombok.Data; - -import java.util.Date; - -@TableName("garden_hotline_case") -@Data -public class HotlineCaseDO extends BaseDO { - @TableId - private String id; - private String hotlinenumber; - private String casefile; - private String title; - private String content; - private String department; - private String taskstate; - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date replayTime; - private String street; -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/hotline/HotlineFileDO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/hotline/HotlineFileDO.java deleted file mode 100644 index 946f0f6..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/hotline/HotlineFileDO.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.zteits.urbanops.module.garden.dal.dataobject.hotline; - -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO; -import lombok.Data; - -@TableName("garden_hotline_file") -@Data -public class HotlineFileDO extends BaseDO { - @TableId - private String caseid; - private String casefile; - private String title; - private String content; -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/hotlinecase/HotlineCaseDO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/hotlinecase/HotlineCaseDO.java new file mode 100644 index 0000000..7631b85 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/hotlinecase/HotlineCaseDO.java @@ -0,0 +1,207 @@ +package com.zteits.urbanops.module.garden.dal.dataobject.hotlinecase; + +import lombok.*; +import java.util.*; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO; + +/** + * 12345案件信息 DO + * + * @author 超级管理员 + */ +@TableName("garden_hotline_case") +@KeySequence("garden_hotline_case_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class HotlineCaseDO extends BaseDO { + + /** + * id + */ + @TableId(type = IdType.INPUT) + private String id; + /** + * 工单编号 + */ + private String hotlinenumber; + /** + * 12345工单文件 + */ + private String casefile; + /** + * 事间来源:默认12345 + */ + private String eventsouce; + /** + * 工单来源:集团 分公司 + */ + private String casesource; + /** + * 市级编号 + */ + private String citynum; + /** + * 区级编号 + */ + private String regionnum; + /** + * 工单状态 + */ + private String taskstate; + /** + * 权属信息 null 无 0权属 1非权属 + */ + private String ownership; + /** + * 部门信息 + */ + private String department; + /** + * 所属街道 + */ + private String street; + /** + * 所属公司 + */ + private String companyid; + /** + * 来电人姓名 + */ + private String callName; + /** + * 来电人手机号 + */ + private String callTel; + /** + * 接件时间 + */ + private LocalDateTime acceptcasetime; + /** + * 截止时间 + */ + private LocalDateTime endTime; + /** + * 详细地址 + */ + private String address; + /** + * 工单内容 + */ + private String content; + /** + * 工单照片 + */ + private String casepic; + /** + * 是否派巡查 + */ + private String dispatcher; + /** + * 巡查员 + */ + private String dispperson; + /** + * 完成情况 + */ + private String replyResult; + /** + * 完成图片1 + */ + private String picResult1; + /** + * 完成图片2 + */ + private String picResult2; + /** + * 完成图片3 + */ + private String picResult3; + /** + * 工单完成时间 + */ + private LocalDateTime finishTime; + /** + * 回复居民时间 + */ + private LocalDateTime replayrtime; + /** + * 权属单位 + */ + private String ownercompany; + /** + * 工单类型 + */ + private String casetype; + /** + * 办理结果:字典 + */ + private String handingresult; + /** + * 处理情况 + */ + private String resolvedesp; + /** + * 处理情况 + */ + private String rstResolvedesp; + /** + * 转单人 + */ + private String dealBy; + /** + * 上报时间 + */ + private LocalDateTime dealTime; + /** + * 创建人 + */ + private String createBy; + /** + * 修改人 + */ + private String updateBy; + /** + * 结果录入人 + */ + private String replayBy; + /** + * 回复时间,结果录入时间 + */ + private LocalDateTime replayTime; + /** + * 确认权属人 + */ + private String ownershipBy; + /** + * 确认权属时间 + */ + private LocalDateTime ownershipTime; + /** + * 防止重复派单:1已经发送 + */ + private String reserve1; + /** + * 小程序派单状态:1 待派单,2 派单中 3 派单处理完成 + */ + private String reserve2; + /** + * 备注3 + */ + private String reserve3; + + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/hotlinefile/HotlineFileDO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/hotlinefile/HotlineFileDO.java new file mode 100644 index 0000000..b1e2adc --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/hotlinefile/HotlineFileDO.java @@ -0,0 +1,43 @@ +package com.zteits.urbanops.module.garden.dal.dataobject.hotlinefile; + +import lombok.*; +import java.util.*; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO; + +/** + * 12345案件-文件 DO + * + * @author 超级管理员 + */ +@TableName("garden_hotline_file") +@KeySequence("garden_hotline_file_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class HotlineFileDO extends BaseDO { + + /** + * 12345案件id + */ + @TableId(type = IdType.INPUT) + private String caseId; + /** + * 文件id + */ + private String fileid; + /** + * 文件类型(办理文件、挂账文件、剔除文件等) + */ + private String filetype; + /** + * 文件上传时间 + */ + private LocalDateTime updatetime; + + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/maintainrate/MaintainRateDO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/maintainrate/MaintainRateDO.java deleted file mode 100644 index 5cbcffa..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/maintainrate/MaintainRateDO.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.zteits.urbanops.module.garden.dal.dataobject.maintainrate; - -import com.baomidou.mybatisplus.annotation.KeySequence; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO; -import lombok.*; - -/** - * 养护频次 DO - */ -@TableName("garden_maintain_rate") -@KeySequence("garden_maintain_rate_seq") -@Data -@EqualsAndHashCode(callSuper = true) -@ToString(callSuper = true) -@Builder -@NoArgsConstructor -@AllArgsConstructor -public class MaintainRateDO extends BaseDO { - - @TableId - private Long id; - - private Integer type; - - private Integer maintainSubjectId; - private String maintainSubjectName; - - private Integer maintainTypeId; - private String maintainTypeName; - - private String levelTop; - private String levelOne; - private String levelTwo; - private String levelThree; - - private Integer cycleId; - private String cycleName; - - private String status; -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/material/MaterialDO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/material/MaterialDO.java index 2ced8a7..d17292a 100644 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/material/MaterialDO.java +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/material/MaterialDO.java @@ -1,30 +1,100 @@ package com.zteits.urbanops.module.garden.dal.dataobject.material; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; +import lombok.*; +import java.util.*; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO; -import lombok.Data; +/** + * 耗材管理 DO + * + * @author 超级管理员 + */ @TableName("garden_material") +@KeySequence("garden_material_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 @Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor public class MaterialDO extends BaseDO { + + /** + * 耗材ID + */ @TableId private Long materialId; + /** + * 完整编码 + */ private String fullCode; + /** + * 物料编码 + */ private String materialCode; + /** + * 耗材名称 + */ private String materialName; + /** + * 耗材类型ID + */ private Long materialTypeId; + /** + * 耗材类型名称 + */ private String materialTypeName; + /** + * 类别ID + */ private Long typeId; + /** + * 类别名称:药品 + */ private String typeName; + /** + * 类别明细ID + */ private Long typeDetailId; + /** + * 类别明细 + */ private String typeDetailName; + /** + * 规格编码 + */ private String specCode; + /** + * 规格 + */ private String specifications; - private Long unitId; - private String unitName; + /** + * 归属公司ID + */ private Long belongCompanyId; + /** + * 归属公司 + */ private String belongCompanyName; - private String status; + /** + * 单位ID + */ + private Long unitId; + /** + * 单位 + */ + private String unitName; + /** + * 备注 + */ + private String remark; + /** + * 是否关联工单:0-否,1-是 + */ private Integer isAssociatedOrder; -} \ No newline at end of file + + +} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/material/MaterialInventoryDO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/material/MaterialInventoryDO.java deleted file mode 100644 index 1ca18c2..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/material/MaterialInventoryDO.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.zteits.urbanops.module.garden.dal.dataobject.material; - -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO; -import lombok.Data; - -@TableName("garden_material_inventory") -@Data -public class MaterialInventoryDO extends BaseDO { - @TableId - private Long inventoryId; - private Long materialId; - private String materialName; - private Long materialTypeId; - private String materialTypeName; - private Long typeId; - private String typeName; - private Long typeDetailId; - private String typeDetailName; - private String specifications; - private Long belongCompanyId; - private String belongCompanyName; - private Long unitId; - private String unitName; - private Long currentNum; - private Long outTotalNum; - private Long inventoryTotalNum; - private String status; - private Long inventoryAlermNum; - private Long deptId; -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/material/MaterialInventoryInDO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/material/MaterialInventoryInDO.java deleted file mode 100644 index 422c54c..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/material/MaterialInventoryInDO.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.zteits.urbanops.module.garden.dal.dataobject.material; - -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO; -import lombok.Data; - -import java.math.BigDecimal; -import java.util.Date; - -@TableName("garden_material_inventory_in") -@Data -public class MaterialInventoryInDO extends BaseDO { - @TableId - private Long id; - private String inventoryInNo; - private Long materialId; - private String materialName; - private Long materialTypeId; - private String materialTypeName; - private Long typeId; - private String typeName; - private Long typeDetailId; - private String typeDetailName; - private String specifications; - private Long belongCompanyId; - private String belongCompanyName; - private Long inInventoryNum; - private BigDecimal materialPrice; - private Long unitId; - private String unitName; - private Date buyDate; - private String supplierName; - private String contactsName; - private String contactsPhone; - private String status; - private Long deptId; -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/material/MaterialInventoryOutDO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/material/MaterialInventoryOutDO.java deleted file mode 100644 index 345b7e0..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/material/MaterialInventoryOutDO.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.zteits.urbanops.module.garden.dal.dataobject.material; - -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO; -import lombok.Data; - -import java.util.Date; - -@TableName("garden_material_inventory_out") -@Data -public class MaterialInventoryOutDO extends BaseDO { - @TableId - private Long id; - private String inventoryOutNo; - private Long materialId; - private String materialName; - private Long materialTypeId; - private String materialTypeName; - private Long typeId; - private String typeName; - private Long typeDetailId; - private String typeDetailName; - private String specifications; - private Long belongCompanyId; - private String belongCompanyName; - private Long outInventoryNum; - private Long unitId; - private String unitName; - private Date outDate; - private String status; - private Integer type; - private Long deptId; -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/material/MaterialTypeDO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/material/MaterialTypeDO.java deleted file mode 100644 index db44d91..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/material/MaterialTypeDO.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.zteits.urbanops.module.garden.dal.dataobject.material; - -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO; -import lombok.Data; - -@TableName("garden_material_type") -@Data -public class MaterialTypeDO extends BaseDO { - @TableId - private Long id; - private String typeName; - private Long parentId; - private Integer level; -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/materialinventory/MaterialInventoryDO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/materialinventory/MaterialInventoryDO.java new file mode 100644 index 0000000..06df02e --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/materialinventory/MaterialInventoryDO.java @@ -0,0 +1,104 @@ +package com.zteits.urbanops.module.garden.dal.dataobject.materialinventory; + +import lombok.*; +import java.util.*; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO; + +/** + * 物料库存 DO + * + * @author 超级管理员 + */ +@TableName("garden_material_inventory") +@KeySequence("garden_material_inventory_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class MaterialInventoryDO extends BaseDO { + + /** + * 库存ID + */ + @TableId + private Long inventoryId; + /** + * 物料ID + */ + private Long materialId; + /** + * 物料名称 + */ + private String materialName; + /** + * 物料类型ID + */ + private Long materialTypeId; + /** + * 耗材类型名称 + */ + private String materialTypeName; + /** + * 类别ID + */ + private Long typeId; + /** + * 类别名称:药品 + */ + private String typeName; + /** + * 类别明细ID + */ + private Long typeDetailId; + /** + * 类别明细 + */ + private String typeDetailName; + /** + * 规格 + */ + private String specifications; + /** + * 归属单位ID + */ + private Long belongCompanyId; + /** + * 归属单位 + */ + private String belongCompanyName; + /** + * 单位ID + */ + private Long unitId; + /** + * 单位 + */ + private String unitName; + /** + * 当前库存数量 + */ + private Long currentNum; + /** + * 出库总数量(出库累加) + */ + private Long outTotalNum; + /** + * 库存总数量(入库累加) + */ + private Long inventoryTotalNum; + /** + * 库存预警阈值 + */ + private Long inventoryAlermNum; + /** + * 部门ID + */ + private Long deptId; + + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/materialinventoryin/MaterialInventoryInDO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/materialinventoryin/MaterialInventoryInDO.java new file mode 100644 index 0000000..22146e3 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/materialinventoryin/MaterialInventoryInDO.java @@ -0,0 +1,118 @@ +package com.zteits.urbanops.module.garden.dal.dataobject.materialinventoryin; + +import lombok.*; +import java.util.*; +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO; + +/** + * 物料入库 DO + * + * @author 超级管理员 + */ +@TableName("garden_material_inventory_in") +@KeySequence("garden_material_inventory_in_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class MaterialInventoryInDO extends BaseDO { + + /** + * 入库ID + */ + @TableId + private Long id; + /** + * 入库批次号 + */ + private String inventoryInNo; + /** + * 物料ID + */ + private Long materialId; + /** + * 物料名称 + */ + private String materialName; + /** + * 物料类型ID + */ + private Long materialTypeId; + /** + * 耗材类型名称 + */ + private String materialTypeName; + /** + * 类别ID + */ + private Long typeId; + /** + * 类别名称:药品 + */ + private String typeName; + /** + * 类别明细ID + */ + private Long typeDetailId; + /** + * 类别明细 + */ + private String typeDetailName; + /** + * 规格 + */ + private String specifications; + /** + * 归属单位ID + */ + private Long belongCompanyId; + /** + * 归属单位 + */ + private String belongCompanyName; + /** + * 入库数量 + */ + private Long inInventoryNum; + /** + * 单价 + */ + private BigDecimal materialPrice; + /** + * 单位ID + */ + private Long unitId; + /** + * 单位 + */ + private String unitName; + /** + * 采购日期 + */ + private LocalDateTime buyDate; + /** + * 供应商名称 + */ + private String supplierName; + /** + * 联系人 + */ + private String contactsName; + /** + * 联系人 电话 + */ + private String contactsPhone; + /** + * 部门ID + */ + private Long deptId; + + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/materialinventoryout/MaterialInventoryOutDO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/materialinventoryout/MaterialInventoryOutDO.java new file mode 100644 index 0000000..cb4de6e --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/materialinventoryout/MaterialInventoryOutDO.java @@ -0,0 +1,109 @@ +package com.zteits.urbanops.module.garden.dal.dataobject.materialinventoryout; + +import lombok.*; +import java.util.*; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO; + +/** + * 物料出库 DO + * + * @author 超级管理员 + */ +@TableName("garden_material_inventory_out") +@KeySequence("garden_material_inventory_out_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class MaterialInventoryOutDO extends BaseDO { + + /** + * 入库ID + */ + @TableId + private Long id; + /** + * 入库批次号 + */ + private String inventoryOutNo; + /** + * 物料ID + */ + private Long materialId; + /** + * 物料名称 + */ + private String materialName; + /** + * 物料类型ID + */ + private Long materialTypeId; + /** + * 耗材类型名称 + */ + private String materialTypeName; + /** + * 类别ID + */ + private Long typeId; + /** + * 类别名称:药品 + */ + private String typeName; + /** + * 类别明细ID + */ + private Long typeDetailId; + /** + * 类别明细 + */ + private String typeDetailName; + /** + * 规格 + */ + private String specifications; + /** + * 归属单位ID + */ + private Long belongCompanyId; + /** + * 归属单位 + */ + private String belongCompanyName; + /** + * 出库数量 + */ + private Long outInventoryNum; + /** + * 单位ID + */ + private Long unitId; + /** + * 单位 + */ + private String unitName; + /** + * 出库日期 + */ + private LocalDateTime outDate; + /** + * 备注 + */ + private String remark; + /** + * 部门ID + */ + private Long deptId; + /** + * 类型: 1:手动出库;2:养护类出库 + */ + private Integer type; + + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/materialtype/MaterialTypeDO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/materialtype/MaterialTypeDO.java new file mode 100644 index 0000000..cc02120 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/materialtype/MaterialTypeDO.java @@ -0,0 +1,68 @@ +package com.zteits.urbanops.module.garden.dal.dataobject.materialtype; + +import lombok.*; +import java.util.*; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO; + +/** + * 物料类型 DO + * + * @author 超级管理员 + */ +@TableName("garden_material_type") +@KeySequence("garden_material_type_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class MaterialTypeDO extends BaseDO { + + /** + * 物料ID + */ + @TableId + private Long id; + /** + * 物料类型ID + */ + private Long materialTypeId; + /** + * 耗材类型名称:工具 + */ + private String materialTypeName; + /** + * 类别ID + */ + private Long typeId; + /** + * 类别名称:药品 + */ + private String typeName; + /** + * 付物料类型ID + */ + private Long materialParentTypeId; + /** + * 类别明细ID + */ + private Long typeDetailId; + /** + * 类别明细 + */ + private String typeDetailName; + /** + * 父类别ID + */ + private Long parentTypeId; + /** + * 备注 + */ + private String remark; + + +} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/materialtype/MaterialTypeManagerDO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/materialtype/MaterialTypeManagerDO.java new file mode 100644 index 0000000..b17e977 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/materialtype/MaterialTypeManagerDO.java @@ -0,0 +1,83 @@ +package com.zteits.urbanops.module.garden.dal.dataobject.materialtype; + +import lombok.*; +import java.util.*; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO; + +/** + * 耗材类别管理 DO + * + * @author 超级管理员 + */ +@TableName("garden_material_type_manager") +@KeySequence("garden_material_type_manager_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class MaterialTypeManagerDO extends BaseDO { + + /** + * ID + */ + @TableId + private Long id; + /** + * 种类ID + */ + private Long classifyId; + /** + * 种类名称 + */ + private String classifyName; + /** + * 类别ID + */ + private Long typeId; + /** + * 类别名称 + */ + private String typeName; + /** + * 类别明细ID + */ + private Long typeDetailId; + /** + * 类别明细名称 + */ + private String typeDetailName; + /** + * 公司ID + */ + private Long companyId; + /** + * 公司名称 + */ + private String companyName; + /** + * 数量 + */ + private Long num; + /** + * 单位ID + */ + private Long unitId; + /** + * 单位 + */ + private String unitName; + /** + * 描述 + */ + private String remark; + /** + * 状态(0正常 1停用) + */ + private Integer status; + +} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/road/RoadDO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/road/RoadDO.java new file mode 100644 index 0000000..e052cb6 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/road/RoadDO.java @@ -0,0 +1,108 @@ +package com.zteits.urbanops.module.garden.dal.dataobject.road; + +import lombok.*; +import java.util.*; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO; + +/** + * 道路管理 DO + * + * @author 超级管理员 + */ +@TableName("garden_road") +@KeySequence("garden_road_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class RoadDO extends BaseDO { + + /** + * ID + */ + @TableId + private Long id; + /** + * 道路名称 + */ + private String roadName; + /** + * 街道ID + */ + private String streetId; + /** + * 街道名称 + */ + private String streetName; + /** + * 养护级别: 10:特级;11:一级:12:二级;13:三级 + */ + private Integer levelId; + /** + * 行道树绿化面积 + */ + private String greenBeltTreeArea; + /** + * 绿化带面积 + */ + private String greenBeltArea; + /** + * 总绿化带面积 + */ + private String totalArea; + /** + * 行道树(棵)面积 + */ + private String treeArea; + /** + * 起点经度 + */ + private String startingLatitude; + /** + * 起点维度 + */ + private String startingLongitude; + /** + * 起点描述 + */ + private String startingRemark; + /** + * 终点经度 + */ + private String endLatitude; + /** + * 终点维度 + */ + private String endLongitude; + /** + * 终点描述 + */ + private String endRemark; + /** + * 备注 + */ + private String remark; + /** + * 归属(一级部门id) + */ + private Long companyId; + /** + * 部门ID(道路负责部门id) + */ + private Long deptId; + /** + * 创建者 + */ + private String creatorName; + /** + * 更新者 + */ + private String updaterName; + + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/road/RoadManagerDO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/road/RoadManagerDO.java deleted file mode 100644 index b415cb0..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/road/RoadManagerDO.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.zteits.urbanops.module.garden.dal.dataobject.road; - -import com.baomidou.mybatisplus.annotation.KeySequence; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO; -import lombok.Data; - -@TableName("garden_road_manager") -@KeySequence("garden_road_manager_seq") -@Data -public class RoadManagerDO extends BaseDO { - @TableId - private Long id; - private String roadName; - private String streetId; - private String streetName; - private Integer curingLevelId; - private String curingLevelName; - private String greenBeltTreeArea; - private String greenBeltArea; - private String totalArea; - private String treeArea; - private String startingLatitude; - private String startingLongitude; - private String startingRemark; - private String endLatitude; - private String endLongitude; - private String endRemark; - private Integer status; - private Long companyId; - private String companyName; - private Long deptId; - private String roadAttr; - private String direction; -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/standingbook/StandingBookDO.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/standingbook/StandingBookDO.java deleted file mode 100644 index 6cb56bc..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/standingbook/StandingBookDO.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.zteits.urbanops.module.garden.dal.dataobject.standingbook; - -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO; -import lombok.Data; - -@TableName("garden_standing_book") -@Data -public class StandingBookDO extends BaseDO { - @TableId - private Long id; - private String standingBookNo; - private String standingBookYear; - private Long belongCompanyId; -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/hotline/HotlineCaseMapper.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/hotline/HotlineCaseMapper.java deleted file mode 100644 index e8fade7..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/hotline/HotlineCaseMapper.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.zteits.urbanops.module.garden.dal.mysql.hotline; - -import com.zteits.urbanops.framework.common.pojo.PageResult; -import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; -import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; -import com.zteits.urbanops.module.garden.dal.dataobject.hotline.HotlineCaseDO; -import org.apache.ibatis.annotations.Mapper; - -@Mapper -public interface HotlineCaseMapper extends BaseMapperX { - default PageResult selectPage(com.zteits.urbanops.framework.common.pojo.PageParam pageParam, HotlineCaseDO where) { - return selectPage(pageParam, null, new LambdaQueryWrapperX() - .likeIfPresent(HotlineCaseDO::getTitle, where.getTitle()) - .likeIfPresent(HotlineCaseDO::getContent, where.getContent()) - .eqIfPresent(HotlineCaseDO::getDepartment, where.getDepartment()) - .eqIfPresent(HotlineCaseDO::getTaskstate, where.getTaskstate()) - .orderByDesc(HotlineCaseDO::getUpdateTime)); - } -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/hotline/HotlineFileMapper.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/hotline/HotlineFileMapper.java deleted file mode 100644 index d6baa55..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/hotline/HotlineFileMapper.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.zteits.urbanops.module.garden.dal.mysql.hotline; - -import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; -import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; -import com.zteits.urbanops.module.garden.dal.dataobject.hotline.HotlineFileDO; -import org.apache.ibatis.annotations.Mapper; - -import java.util.List; - -@Mapper -public interface HotlineFileMapper extends BaseMapperX { - default List selectList(HotlineFileDO where) { - return selectList(new LambdaQueryWrapperX() - .likeIfPresent(HotlineFileDO::getTitle, where.getTitle()) - .likeIfPresent(HotlineFileDO::getContent, where.getContent())); - } -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/hotlinecase/HotlineCaseMapper.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/hotlinecase/HotlineCaseMapper.java new file mode 100644 index 0000000..4494131 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/hotlinecase/HotlineCaseMapper.java @@ -0,0 +1,68 @@ +package com.zteits.urbanops.module.garden.dal.mysql.hotlinecase; + +import java.util.*; + +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; +import com.zteits.urbanops.module.garden.dal.dataobject.hotlinecase.HotlineCaseDO; +import org.apache.ibatis.annotations.Mapper; +import com.zteits.urbanops.module.garden.controller.admin.hotlinecase.vo.*; + +/** + * 12345案件信息 Mapper + * + * @author 超级管理员 + */ +@Mapper +public interface HotlineCaseMapper extends BaseMapperX { + + default PageResult selectPage(HotlineCasePageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(HotlineCaseDO::getHotlinenumber, reqVO.getHotlinenumber()) + .eqIfPresent(HotlineCaseDO::getCasefile, reqVO.getCasefile()) + .eqIfPresent(HotlineCaseDO::getEventsouce, reqVO.getEventsouce()) + .eqIfPresent(HotlineCaseDO::getCasesource, reqVO.getCasesource()) + .eqIfPresent(HotlineCaseDO::getCitynum, reqVO.getCitynum()) + .eqIfPresent(HotlineCaseDO::getRegionnum, reqVO.getRegionnum()) + .eqIfPresent(HotlineCaseDO::getTaskstate, reqVO.getTaskstate()) + .eqIfPresent(HotlineCaseDO::getOwnership, reqVO.getOwnership()) + .eqIfPresent(HotlineCaseDO::getDepartment, reqVO.getDepartment()) + .eqIfPresent(HotlineCaseDO::getStreet, reqVO.getStreet()) + .eqIfPresent(HotlineCaseDO::getCompanyid, reqVO.getCompanyid()) + .likeIfPresent(HotlineCaseDO::getCallName, reqVO.getCallName()) + .eqIfPresent(HotlineCaseDO::getCallTel, reqVO.getCallTel()) + .betweenIfPresent(HotlineCaseDO::getAcceptcasetime, reqVO.getAcceptcasetime()) + .betweenIfPresent(HotlineCaseDO::getEndTime, reqVO.getEndTime()) + .eqIfPresent(HotlineCaseDO::getAddress, reqVO.getAddress()) + .eqIfPresent(HotlineCaseDO::getContent, reqVO.getContent()) + .eqIfPresent(HotlineCaseDO::getCasepic, reqVO.getCasepic()) + .eqIfPresent(HotlineCaseDO::getDispatcher, reqVO.getDispatcher()) + .eqIfPresent(HotlineCaseDO::getDispperson, reqVO.getDispperson()) + .eqIfPresent(HotlineCaseDO::getReplyResult, reqVO.getReplyResult()) + .eqIfPresent(HotlineCaseDO::getPicResult1, reqVO.getPicResult1()) + .eqIfPresent(HotlineCaseDO::getPicResult2, reqVO.getPicResult2()) + .eqIfPresent(HotlineCaseDO::getPicResult3, reqVO.getPicResult3()) + .betweenIfPresent(HotlineCaseDO::getFinishTime, reqVO.getFinishTime()) + .betweenIfPresent(HotlineCaseDO::getReplayrtime, reqVO.getReplayrtime()) + .eqIfPresent(HotlineCaseDO::getOwnercompany, reqVO.getOwnercompany()) + .eqIfPresent(HotlineCaseDO::getCasetype, reqVO.getCasetype()) + .eqIfPresent(HotlineCaseDO::getHandingresult, reqVO.getHandingresult()) + .eqIfPresent(HotlineCaseDO::getResolvedesp, reqVO.getResolvedesp()) + .eqIfPresent(HotlineCaseDO::getRstResolvedesp, reqVO.getRstResolvedesp()) + .eqIfPresent(HotlineCaseDO::getDealBy, reqVO.getDealBy()) + .betweenIfPresent(HotlineCaseDO::getDealTime, reqVO.getDealTime()) + .eqIfPresent(HotlineCaseDO::getCreateBy, reqVO.getCreateBy()) + .betweenIfPresent(HotlineCaseDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(HotlineCaseDO::getUpdateBy, reqVO.getUpdateBy()) + .eqIfPresent(HotlineCaseDO::getReplayBy, reqVO.getReplayBy()) + .betweenIfPresent(HotlineCaseDO::getReplayTime, reqVO.getReplayTime()) + .eqIfPresent(HotlineCaseDO::getOwnershipBy, reqVO.getOwnershipBy()) + .betweenIfPresent(HotlineCaseDO::getOwnershipTime, reqVO.getOwnershipTime()) + .eqIfPresent(HotlineCaseDO::getReserve1, reqVO.getReserve1()) + .eqIfPresent(HotlineCaseDO::getReserve2, reqVO.getReserve2()) + .eqIfPresent(HotlineCaseDO::getReserve3, reqVO.getReserve3()) + .orderByDesc(HotlineCaseDO::getId)); + } + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/hotlinefile/HotlineFileMapper.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/hotlinefile/HotlineFileMapper.java new file mode 100644 index 0000000..c18e754 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/hotlinefile/HotlineFileMapper.java @@ -0,0 +1,29 @@ +package com.zteits.urbanops.module.garden.dal.mysql.hotlinefile; + +import java.util.*; + +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; +import com.zteits.urbanops.module.garden.dal.dataobject.hotlinefile.HotlineFileDO; +import org.apache.ibatis.annotations.Mapper; +import com.zteits.urbanops.module.garden.controller.admin.hotlinefile.vo.*; + +/** + * 12345案件-文件 Mapper + * + * @author 超级管理员 + */ +@Mapper +public interface HotlineFileMapper extends BaseMapperX { + + default PageResult selectPage(HotlineFilePageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(HotlineFileDO::getCaseId, reqVO.getCaseId()) + .eqIfPresent(HotlineFileDO::getFileid, reqVO.getFileid()) + .eqIfPresent(HotlineFileDO::getFiletype, reqVO.getFiletype()) + .betweenIfPresent(HotlineFileDO::getUpdatetime, reqVO.getUpdatetime()) + .orderByDesc(HotlineFileDO::getCaseId)); + } + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/maintainrate/MaintainRateMapper.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/maintainrate/MaintainRateMapper.java deleted file mode 100644 index 22a22f4..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/maintainrate/MaintainRateMapper.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.zteits.urbanops.module.garden.dal.mysql.maintainrate; - -import com.zteits.urbanops.framework.common.pojo.PageResult; -import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; -import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; -import com.zteits.urbanops.module.garden.dal.dataobject.maintainrate.MaintainRateDO; -import com.zteits.urbanops.module.garden.controller.admin.maintainrate.vo.MaintainRatePageReqVO; -import org.apache.ibatis.annotations.Mapper; - -@Mapper -public interface MaintainRateMapper extends BaseMapperX { - - default PageResult selectPage(MaintainRatePageReqVO reqVO) { - return selectPage(reqVO, new LambdaQueryWrapperX() - .eqIfPresent(MaintainRateDO::getType, reqVO.getType()) - .eqIfPresent(MaintainRateDO::getMaintainSubjectId, reqVO.getMaintainSubjectId()) - .likeIfPresent(MaintainRateDO::getMaintainSubjectName, reqVO.getMaintainSubjectName()) - .eqIfPresent(MaintainRateDO::getMaintainTypeId, reqVO.getMaintainTypeId()) - .likeIfPresent(MaintainRateDO::getMaintainTypeName, reqVO.getMaintainTypeName()) - .eqIfPresent(MaintainRateDO::getCycleId, reqVO.getCycleId()) - .likeIfPresent(MaintainRateDO::getCycleName, reqVO.getCycleName()) - .eqIfPresent(MaintainRateDO::getStatus, reqVO.getStatus()) - .orderByDesc(MaintainRateDO::getId)); - } -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/material/MaterialInventoryInMapper.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/material/MaterialInventoryInMapper.java deleted file mode 100644 index f570329..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/material/MaterialInventoryInMapper.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.zteits.urbanops.module.garden.dal.mysql.material; - -import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialInventoryInDO; -import org.apache.ibatis.annotations.Mapper; - -@Mapper -public interface MaterialInventoryInMapper extends BaseMapperX { - default MaterialInventoryInDO selectByNo(String inventoryInNo) { - return selectOne(new com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX() - .eq(MaterialInventoryInDO::getInventoryInNo, inventoryInNo)); - } -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/material/MaterialInventoryMapper.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/material/MaterialInventoryMapper.java deleted file mode 100644 index 253e8c8..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/material/MaterialInventoryMapper.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.zteits.urbanops.module.garden.dal.mysql.material; - -import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; -import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialInventoryDO; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -@Mapper -public interface MaterialInventoryMapper extends BaseMapperX { - - default MaterialInventoryDO selectByMaterialId(Long materialId) { - return selectOne(new LambdaQueryWrapperX().eq(MaterialInventoryDO::getMaterialId, materialId)); - } - - default MaterialInventoryDO selectByTypeDetailId(Long typeDetailId, Long companyId) { - return selectOne(new LambdaQueryWrapperX() - .eq(MaterialInventoryDO::getTypeDetailId, typeDetailId) - .eq(MaterialInventoryDO::getBelongCompanyId, companyId)); - } - - default int updateInventoryByMaterialId(Long inventoryId, Long outNum) { - MaterialInventoryDO inv = selectById(inventoryId); - if (inv == null) return 0; - MaterialInventoryDO upd = new MaterialInventoryDO(); - upd.setInventoryId(inventoryId); - upd.setCurrentNum(inv.getCurrentNum() - outNum); - upd.setOutTotalNum(inv.getOutTotalNum() == null ? outNum : inv.getOutTotalNum() + outNum); - return updateById(upd); - } - - default int updateInventoryAlarmNum(Long materialId, Long inventoryAlermNum) { - MaterialInventoryDO inv = selectByMaterialId(materialId); - if (inv == null) return 0; - MaterialInventoryDO upd = new MaterialInventoryDO(); - upd.setInventoryId(inv.getInventoryId()); - upd.setInventoryAlermNum(inventoryAlermNum); - return updateById(upd); - } -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/material/MaterialInventoryOutMapper.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/material/MaterialInventoryOutMapper.java deleted file mode 100644 index 496da02..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/material/MaterialInventoryOutMapper.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.zteits.urbanops.module.garden.dal.mysql.material; - -import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialInventoryOutDO; -import org.apache.ibatis.annotations.Mapper; - -@Mapper -public interface MaterialInventoryOutMapper extends BaseMapperX { -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/material/MaterialManagerMapper.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/material/MaterialManagerMapper.java deleted file mode 100644 index 5392365..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/material/MaterialManagerMapper.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.zteits.urbanops.module.garden.dal.mysql.material; - -import com.zteits.urbanops.framework.common.pojo.PageResult; -import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; -import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialManagerDO; -import org.apache.ibatis.annotations.Mapper; - -import java.util.List; - -@Mapper -public interface MaterialManagerMapper extends BaseMapperX { - default PageResult selectPage(com.zteits.urbanops.framework.common.pojo.PageParam pageParam, MaterialManagerDO where) { - return selectPage(pageParam, null, new LambdaQueryWrapperX() - .likeIfPresent(MaterialManagerDO::getName, where.getName()) - .eqIfPresent(MaterialManagerDO::getDeptId, where.getDeptId()) - .orderByDesc(MaterialManagerDO::getUpdateTime)); - } - - default List selectList(MaterialManagerDO where) { - return selectList(new LambdaQueryWrapperX() - .likeIfPresent(MaterialManagerDO::getName, where.getName()) - .eqIfPresent(MaterialManagerDO::getDeptId, where.getDeptId()) - .orderByAsc(MaterialManagerDO::getName)); - } -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/material/MaterialMapper.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/material/MaterialMapper.java index 9e9456b..d0ffdcc 100644 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/material/MaterialMapper.java +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/material/MaterialMapper.java @@ -1,9 +1,43 @@ package com.zteits.urbanops.module.garden.dal.mysql.material; +import java.util.*; + +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialDO; import org.apache.ibatis.annotations.Mapper; +import com.zteits.urbanops.module.garden.controller.admin.material.vo.*; +/** + * 耗材管理 Mapper + * + * @author 超级管理员 + */ @Mapper public interface MaterialMapper extends BaseMapperX { -} \ No newline at end of file + + default PageResult selectPage(MaterialPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(MaterialDO::getFullCode, reqVO.getFullCode()) + .eqIfPresent(MaterialDO::getMaterialCode, reqVO.getMaterialCode()) + .likeIfPresent(MaterialDO::getMaterialName, reqVO.getMaterialName()) + .eqIfPresent(MaterialDO::getMaterialTypeId, reqVO.getMaterialTypeId()) + .likeIfPresent(MaterialDO::getMaterialTypeName, reqVO.getMaterialTypeName()) + .eqIfPresent(MaterialDO::getTypeId, reqVO.getTypeId()) + .likeIfPresent(MaterialDO::getTypeName, reqVO.getTypeName()) + .eqIfPresent(MaterialDO::getTypeDetailId, reqVO.getTypeDetailId()) + .likeIfPresent(MaterialDO::getTypeDetailName, reqVO.getTypeDetailName()) + .eqIfPresent(MaterialDO::getSpecCode, reqVO.getSpecCode()) + .eqIfPresent(MaterialDO::getSpecifications, reqVO.getSpecifications()) + .eqIfPresent(MaterialDO::getBelongCompanyId, reqVO.getBelongCompanyId()) + .likeIfPresent(MaterialDO::getBelongCompanyName, reqVO.getBelongCompanyName()) + .eqIfPresent(MaterialDO::getUnitId, reqVO.getUnitId()) + .likeIfPresent(MaterialDO::getUnitName, reqVO.getUnitName()) + .betweenIfPresent(MaterialDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(MaterialDO::getRemark, reqVO.getRemark()) + .eqIfPresent(MaterialDO::getIsAssociatedOrder, reqVO.getIsAssociatedOrder()) + .orderByDesc(MaterialDO::getMaterialId)); + } + +} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/material/MaterialTypeMapper.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/material/MaterialTypeMapper.java deleted file mode 100644 index fb0ebd7..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/material/MaterialTypeMapper.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.zteits.urbanops.module.garden.dal.mysql.material; - -import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; -import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialTypeDO; -import org.apache.ibatis.annotations.Mapper; - -import java.util.List; - -@Mapper -public interface MaterialTypeMapper extends BaseMapperX { - default List selectBigTypeList() { - return selectList(new LambdaQueryWrapperX().eq(MaterialTypeDO::getLevel, 1).orderByAsc(MaterialTypeDO::getTypeName)); - } - - default com.zteits.urbanops.framework.common.pojo.PageResult selectPage(com.zteits.urbanops.framework.common.pojo.PageParam pageParam, MaterialTypeDO where) { - return selectPage(pageParam, null, new LambdaQueryWrapperX() - .likeIfPresent(MaterialTypeDO::getTypeName, where.getTypeName()) - .eqIfPresent(MaterialTypeDO::getParentId, where.getParentId()) - .orderByAsc(MaterialTypeDO::getTypeName)); - } -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/materialinventory/MaterialInventoryMapper.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/materialinventory/MaterialInventoryMapper.java new file mode 100644 index 0000000..bc6e60b --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/materialinventory/MaterialInventoryMapper.java @@ -0,0 +1,44 @@ +package com.zteits.urbanops.module.garden.dal.mysql.materialinventory; + +import java.util.*; + +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; +import com.zteits.urbanops.module.garden.dal.dataobject.materialinventory.MaterialInventoryDO; +import org.apache.ibatis.annotations.Mapper; +import com.zteits.urbanops.module.garden.controller.admin.materialinventory.vo.*; + +/** + * 物料库存 Mapper + * + * @author 超级管理员 + */ +@Mapper +public interface MaterialInventoryMapper extends BaseMapperX { + + default PageResult selectPage(MaterialInventoryPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(MaterialInventoryDO::getMaterialId, reqVO.getMaterialId()) + .likeIfPresent(MaterialInventoryDO::getMaterialName, reqVO.getMaterialName()) + .eqIfPresent(MaterialInventoryDO::getMaterialTypeId, reqVO.getMaterialTypeId()) + .likeIfPresent(MaterialInventoryDO::getMaterialTypeName, reqVO.getMaterialTypeName()) + .eqIfPresent(MaterialInventoryDO::getTypeId, reqVO.getTypeId()) + .likeIfPresent(MaterialInventoryDO::getTypeName, reqVO.getTypeName()) + .eqIfPresent(MaterialInventoryDO::getTypeDetailId, reqVO.getTypeDetailId()) + .likeIfPresent(MaterialInventoryDO::getTypeDetailName, reqVO.getTypeDetailName()) + .eqIfPresent(MaterialInventoryDO::getSpecifications, reqVO.getSpecifications()) + .eqIfPresent(MaterialInventoryDO::getBelongCompanyId, reqVO.getBelongCompanyId()) + .likeIfPresent(MaterialInventoryDO::getBelongCompanyName, reqVO.getBelongCompanyName()) + .eqIfPresent(MaterialInventoryDO::getUnitId, reqVO.getUnitId()) + .likeIfPresent(MaterialInventoryDO::getUnitName, reqVO.getUnitName()) + .eqIfPresent(MaterialInventoryDO::getCurrentNum, reqVO.getCurrentNum()) + .eqIfPresent(MaterialInventoryDO::getOutTotalNum, reqVO.getOutTotalNum()) + .eqIfPresent(MaterialInventoryDO::getInventoryTotalNum, reqVO.getInventoryTotalNum()) + .betweenIfPresent(MaterialInventoryDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(MaterialInventoryDO::getInventoryAlermNum, reqVO.getInventoryAlermNum()) + .eqIfPresent(MaterialInventoryDO::getDeptId, reqVO.getDeptId()) + .orderByDesc(MaterialInventoryDO::getMaterialId)); + } + +} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/materialinventoryin/MaterialInventoryInMapper.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/materialinventoryin/MaterialInventoryInMapper.java new file mode 100644 index 0000000..7b175bf --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/materialinventoryin/MaterialInventoryInMapper.java @@ -0,0 +1,47 @@ +package com.zteits.urbanops.module.garden.dal.mysql.materialinventoryin; + +import java.util.*; + +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; +import com.zteits.urbanops.module.garden.dal.dataobject.materialinventoryin.MaterialInventoryInDO; +import org.apache.ibatis.annotations.Mapper; +import com.zteits.urbanops.module.garden.controller.admin.materialinventoryin.vo.*; + +/** + * 物料入库 Mapper + * + * @author 超级管理员 + */ +@Mapper +public interface MaterialInventoryInMapper extends BaseMapperX { + + default PageResult selectPage(MaterialInventoryInPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(MaterialInventoryInDO::getInventoryInNo, reqVO.getInventoryInNo()) + .eqIfPresent(MaterialInventoryInDO::getMaterialId, reqVO.getMaterialId()) + .likeIfPresent(MaterialInventoryInDO::getMaterialName, reqVO.getMaterialName()) + .eqIfPresent(MaterialInventoryInDO::getMaterialTypeId, reqVO.getMaterialTypeId()) + .likeIfPresent(MaterialInventoryInDO::getMaterialTypeName, reqVO.getMaterialTypeName()) + .eqIfPresent(MaterialInventoryInDO::getTypeId, reqVO.getTypeId()) + .likeIfPresent(MaterialInventoryInDO::getTypeName, reqVO.getTypeName()) + .eqIfPresent(MaterialInventoryInDO::getTypeDetailId, reqVO.getTypeDetailId()) + .likeIfPresent(MaterialInventoryInDO::getTypeDetailName, reqVO.getTypeDetailName()) + .eqIfPresent(MaterialInventoryInDO::getSpecifications, reqVO.getSpecifications()) + .eqIfPresent(MaterialInventoryInDO::getBelongCompanyId, reqVO.getBelongCompanyId()) + .likeIfPresent(MaterialInventoryInDO::getBelongCompanyName, reqVO.getBelongCompanyName()) + .eqIfPresent(MaterialInventoryInDO::getInInventoryNum, reqVO.getInInventoryNum()) + .eqIfPresent(MaterialInventoryInDO::getMaterialPrice, reqVO.getMaterialPrice()) + .eqIfPresent(MaterialInventoryInDO::getUnitId, reqVO.getUnitId()) + .likeIfPresent(MaterialInventoryInDO::getUnitName, reqVO.getUnitName()) + .betweenIfPresent(MaterialInventoryInDO::getBuyDate, reqVO.getBuyDate()) + .likeIfPresent(MaterialInventoryInDO::getSupplierName, reqVO.getSupplierName()) + .likeIfPresent(MaterialInventoryInDO::getContactsName, reqVO.getContactsName()) + .eqIfPresent(MaterialInventoryInDO::getContactsPhone, reqVO.getContactsPhone()) + .betweenIfPresent(MaterialInventoryInDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(MaterialInventoryInDO::getDeptId, reqVO.getDeptId()) + .orderByDesc(MaterialInventoryInDO::getId)); + } + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/materialinventoryout/MaterialInventoryOutMapper.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/materialinventoryout/MaterialInventoryOutMapper.java new file mode 100644 index 0000000..854b8d5 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/materialinventoryout/MaterialInventoryOutMapper.java @@ -0,0 +1,45 @@ +package com.zteits.urbanops.module.garden.dal.mysql.materialinventoryout; + +import java.util.*; + +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; +import com.zteits.urbanops.module.garden.dal.dataobject.materialinventoryout.MaterialInventoryOutDO; +import org.apache.ibatis.annotations.Mapper; +import com.zteits.urbanops.module.garden.controller.admin.materialinventoryout.vo.*; + +/** + * 物料出库 Mapper + * + * @author 超级管理员 + */ +@Mapper +public interface MaterialInventoryOutMapper extends BaseMapperX { + + default PageResult selectPage(MaterialInventoryOutPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(MaterialInventoryOutDO::getInventoryOutNo, reqVO.getInventoryOutNo()) + .eqIfPresent(MaterialInventoryOutDO::getMaterialId, reqVO.getMaterialId()) + .likeIfPresent(MaterialInventoryOutDO::getMaterialName, reqVO.getMaterialName()) + .eqIfPresent(MaterialInventoryOutDO::getMaterialTypeId, reqVO.getMaterialTypeId()) + .likeIfPresent(MaterialInventoryOutDO::getMaterialTypeName, reqVO.getMaterialTypeName()) + .eqIfPresent(MaterialInventoryOutDO::getTypeId, reqVO.getTypeId()) + .likeIfPresent(MaterialInventoryOutDO::getTypeName, reqVO.getTypeName()) + .eqIfPresent(MaterialInventoryOutDO::getTypeDetailId, reqVO.getTypeDetailId()) + .likeIfPresent(MaterialInventoryOutDO::getTypeDetailName, reqVO.getTypeDetailName()) + .eqIfPresent(MaterialInventoryOutDO::getSpecifications, reqVO.getSpecifications()) + .eqIfPresent(MaterialInventoryOutDO::getBelongCompanyId, reqVO.getBelongCompanyId()) + .likeIfPresent(MaterialInventoryOutDO::getBelongCompanyName, reqVO.getBelongCompanyName()) + .eqIfPresent(MaterialInventoryOutDO::getOutInventoryNum, reqVO.getOutInventoryNum()) + .eqIfPresent(MaterialInventoryOutDO::getUnitId, reqVO.getUnitId()) + .likeIfPresent(MaterialInventoryOutDO::getUnitName, reqVO.getUnitName()) + .betweenIfPresent(MaterialInventoryOutDO::getOutDate, reqVO.getOutDate()) + .eqIfPresent(MaterialInventoryOutDO::getRemark, reqVO.getRemark()) + .betweenIfPresent(MaterialInventoryOutDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(MaterialInventoryOutDO::getDeptId, reqVO.getDeptId()) + .eqIfPresent(MaterialInventoryOutDO::getType, reqVO.getType()) + .orderByDesc(MaterialInventoryOutDO::getId)); + } + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/materialtype/MaterialTypeManagerMapper.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/materialtype/MaterialTypeManagerMapper.java new file mode 100644 index 0000000..70482b3 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/materialtype/MaterialTypeManagerMapper.java @@ -0,0 +1,37 @@ +package com.zteits.urbanops.module.garden.dal.mysql.materialtype; + +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; +import com.zteits.urbanops.module.garden.controller.admin.materialtype.vo.MaterialTypeManagerPageReqVO; +import com.zteits.urbanops.module.garden.dal.dataobject.materialtype.MaterialTypeManagerDO; +import org.apache.ibatis.annotations.Mapper; + +/** + * 耗材类别管理 Mapper + * + * @author 超级管理员 + */ +@Mapper +public interface MaterialTypeManagerMapper extends BaseMapperX { + + default PageResult selectPage(MaterialTypeManagerPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(MaterialTypeManagerDO::getClassifyId, reqVO.getClassifyId()) + .likeIfPresent(MaterialTypeManagerDO::getClassifyName, reqVO.getClassifyName()) + .eqIfPresent(MaterialTypeManagerDO::getTypeId, reqVO.getTypeId()) + .likeIfPresent(MaterialTypeManagerDO::getTypeName, reqVO.getTypeName()) + .eqIfPresent(MaterialTypeManagerDO::getTypeDetailId, reqVO.getTypeDetailId()) + .likeIfPresent(MaterialTypeManagerDO::getTypeDetailName, reqVO.getTypeDetailName()) + .eqIfPresent(MaterialTypeManagerDO::getCompanyId, reqVO.getCompanyId()) + .likeIfPresent(MaterialTypeManagerDO::getCompanyName, reqVO.getCompanyName()) + .eqIfPresent(MaterialTypeManagerDO::getNum, reqVO.getNum()) + .eqIfPresent(MaterialTypeManagerDO::getUnitId, reqVO.getUnitId()) + .likeIfPresent(MaterialTypeManagerDO::getUnitName, reqVO.getUnitName()) + .eqIfPresent(MaterialTypeManagerDO::getRemark, reqVO.getRemark()) + .eqIfPresent(MaterialTypeManagerDO::getStatus, reqVO.getStatus()) + .betweenIfPresent(MaterialTypeManagerDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(MaterialTypeManagerDO::getId)); + } + +} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/materialtype/MaterialTypeMapper.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/materialtype/MaterialTypeMapper.java new file mode 100644 index 0000000..4bab48d --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/materialtype/MaterialTypeMapper.java @@ -0,0 +1,24 @@ +package com.zteits.urbanops.module.garden.dal.mysql.materialtype; + +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; +import com.zteits.urbanops.module.garden.controller.admin.materialtype.vo.MaterialTypePageReqVO; +import com.zteits.urbanops.module.garden.dal.dataobject.materialtype.MaterialTypeDO; +import org.apache.ibatis.annotations.Mapper; + +/** + * 物料类型 Mapper + * + * @author 超级管理员 + */ +@Mapper +public interface MaterialTypeMapper extends BaseMapperX { + + default PageResult selectPage(MaterialTypePageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .likeIfPresent(MaterialTypeDO::getTypeName, reqVO.getTypeName()) + .orderByDesc(MaterialTypeDO::getId)); + } + +} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/road/RoadManagerMapper.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/road/RoadManagerMapper.java deleted file mode 100644 index a571fd3..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/road/RoadManagerMapper.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.zteits.urbanops.module.garden.dal.mysql.road; - -import com.zteits.urbanops.framework.common.pojo.PageResult; -import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; -import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; -import com.zteits.urbanops.module.garden.controller.admin.roadmanager.vo.RoadManagerPageReqVO; -import com.zteits.urbanops.module.garden.dal.dataobject.road.RoadManagerDO; -import org.apache.ibatis.annotations.Mapper; - -@Mapper -public interface RoadManagerMapper extends BaseMapperX { - - default PageResult selectPage(RoadManagerPageReqVO reqVO) { - return selectPage(reqVO, new LambdaQueryWrapperX() - .likeIfPresent(RoadManagerDO::getRoadName, reqVO.getRoadName()) - .eqIfPresent(RoadManagerDO::getStreetId, reqVO.getStreetId()) - .likeIfPresent(RoadManagerDO::getStreetName, reqVO.getStreetName()) - .eqIfPresent(RoadManagerDO::getCuringLevelId, reqVO.getCuringLevelId()) - .likeIfPresent(RoadManagerDO::getCuringLevelName, reqVO.getCuringLevelName()) - .eqIfPresent(RoadManagerDO::getCompanyId, reqVO.getCompanyId()) - .eqIfPresent(RoadManagerDO::getDeptId, reqVO.getDeptId()) - .eqIfPresent(RoadManagerDO::getStatus, reqVO.getStatus()) - .orderByDesc(RoadManagerDO::getId)); - } -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/road/RoadMapper.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/road/RoadMapper.java new file mode 100644 index 0000000..406671d --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/road/RoadMapper.java @@ -0,0 +1,45 @@ +package com.zteits.urbanops.module.garden.dal.mysql.road; + +import java.util.*; + +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; +import com.zteits.urbanops.module.garden.dal.dataobject.road.RoadDO; +import org.apache.ibatis.annotations.Mapper; +import com.zteits.urbanops.module.garden.controller.admin.road.vo.*; + +/** + * 道路管理 Mapper + * + * @author 超级管理员 + */ +@Mapper +public interface RoadMapper extends BaseMapperX { + + default PageResult selectPage(RoadPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .likeIfPresent(RoadDO::getRoadName, reqVO.getRoadName()) + .eqIfPresent(RoadDO::getStreetId, reqVO.getStreetId()) + .likeIfPresent(RoadDO::getStreetName, reqVO.getStreetName()) + .eqIfPresent(RoadDO::getLevelId, reqVO.getLevelId()) + .eqIfPresent(RoadDO::getGreenBeltTreeArea, reqVO.getGreenBeltTreeArea()) + .eqIfPresent(RoadDO::getGreenBeltArea, reqVO.getGreenBeltArea()) + .eqIfPresent(RoadDO::getTotalArea, reqVO.getTotalArea()) + .eqIfPresent(RoadDO::getTreeArea, reqVO.getTreeArea()) + .eqIfPresent(RoadDO::getStartingLatitude, reqVO.getStartingLatitude()) + .eqIfPresent(RoadDO::getStartingLongitude, reqVO.getStartingLongitude()) + .eqIfPresent(RoadDO::getStartingRemark, reqVO.getStartingRemark()) + .eqIfPresent(RoadDO::getEndLatitude, reqVO.getEndLatitude()) + .eqIfPresent(RoadDO::getEndLongitude, reqVO.getEndLongitude()) + .eqIfPresent(RoadDO::getEndRemark, reqVO.getEndRemark()) + .eqIfPresent(RoadDO::getRemark, reqVO.getRemark()) + .eqIfPresent(RoadDO::getCompanyId, reqVO.getCompanyId()) + .eqIfPresent(RoadDO::getDeptId, reqVO.getDeptId()) + .likeIfPresent(RoadDO::getCreatorName, reqVO.getCreatorName()) + .betweenIfPresent(RoadDO::getCreateTime, reqVO.getCreateTime()) + .likeIfPresent(RoadDO::getUpdaterName, reqVO.getUpdaterName()) + .orderByDesc(RoadDO::getId)); + } + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/standingbook/StandingBookMapper.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/standingbook/StandingBookMapper.java deleted file mode 100644 index 9c7f6c5..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/standingbook/StandingBookMapper.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.zteits.urbanops.module.garden.dal.mysql.standingbook; - -import com.zteits.urbanops.framework.common.pojo.PageResult; -import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; -import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; -import com.zteits.urbanops.module.garden.dal.dataobject.standingbook.StandingBookDO; -import org.apache.ibatis.annotations.Mapper; - -@Mapper -public interface StandingBookMapper extends BaseMapperX { - default PageResult selectPage(com.zteits.urbanops.framework.common.pojo.PageParam pageParam, StandingBookDO where) { - return selectPage(pageParam, null, new LambdaQueryWrapperX() - .eqIfPresent(StandingBookDO::getStandingBookYear, where.getStandingBookYear()) - .orderByDesc(StandingBookDO::getId)); - } -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/enums/ErrorCodeConstants.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/enums/ErrorCodeConstants.java index 74e1655..34eec00 100644 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/enums/ErrorCodeConstants.java +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/enums/ErrorCodeConstants.java @@ -72,4 +72,19 @@ public interface ErrorCodeConstants { ErrorCode PLAN_RATE_EXISTS = new ErrorCode(1-200-200-001, "养护频次已存在"); ErrorCode PLAN_RATE_LEVEL_ID_DUPLICATE = new ErrorCode(1-200-200-002, "养护等级重复"); + ErrorCode MATERIAL_TYPE_NOT_EXISTS = new ErrorCode(1-100-004-001, "物料类型不存在"); + ErrorCode MATERIAL_TYPE_MANAGER_NOT_EXISTS = new ErrorCode(1-100-004-002, "耗材类别管理不存在"); + + ErrorCode MATERIAL_NOT_EXISTS = new ErrorCode(1-100-004-003, "耗材管理不存在"); + + + ErrorCode HOTLINE_FILE_NOT_EXISTS = new ErrorCode(1-300-001-001, "12345案件-文件不存在"); + + ErrorCode HOTLINE_CASE_NOT_EXISTS = new ErrorCode(1-300-001-002, "12345案件-案件不存在"); + + + ErrorCode MATERIAL_INVENTORY_IN_NOT_EXISTS = new ErrorCode(1-100-004-004, "物料入库不存在"); + + ErrorCode MATERIAL_INVENTORY_OUT_NOT_EXISTS = new ErrorCode(1-100-004-005, "物料出库不存在"); + ErrorCode MATERIAL_INVENTORY_NOT_EXISTS = new ErrorCode(1-100-004-006, "物料库存不存在"); } diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/hotline/HotlineCaseService.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/hotline/HotlineCaseService.java deleted file mode 100644 index 7928efa..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/hotline/HotlineCaseService.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.zteits.urbanops.module.garden.service.hotline; - -import com.zteits.urbanops.framework.common.pojo.PageParam; -import com.zteits.urbanops.framework.common.pojo.PageResult; -import com.zteits.urbanops.module.garden.dal.dataobject.hotline.HotlineCaseDO; - -public interface HotlineCaseService { - PageResult selectPage(PageParam pageParam, HotlineCaseDO where); - HotlineCaseDO selectById(String id); - Boolean insert(HotlineCaseDO entity); - Boolean update(HotlineCaseDO entity); - Boolean deleteByIds(java.util.List ids); - com.zteits.urbanops.module.garden.controller.admin.hotline.vo.HotlineCaseDetailResp getDetail(String id); -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/hotline/HotlineCaseServiceImpl.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/hotline/HotlineCaseServiceImpl.java deleted file mode 100644 index 3302b0e..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/hotline/HotlineCaseServiceImpl.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.zteits.urbanops.module.garden.service.hotline; - -import com.zteits.urbanops.framework.common.pojo.PageParam; -import com.zteits.urbanops.framework.common.pojo.PageResult; -import com.zteits.urbanops.module.garden.dal.dataobject.hotline.HotlineCaseDO; -import com.zteits.urbanops.module.garden.dal.dataobject.hotline.HotlineFileDO; -import com.zteits.urbanops.module.garden.dal.dataobject.photo.SysPhotoDO; -import com.zteits.urbanops.module.garden.dal.mysql.hotline.HotlineCaseMapper; -import com.zteits.urbanops.module.garden.dal.mysql.hotline.HotlineFileMapper; -import com.zteits.urbanops.module.garden.dal.mysql.photo.SysPhotoMapper; -import jakarta.annotation.Resource; -import org.springframework.stereotype.Service; - -import java.util.List; - -@Service -public class HotlineCaseServiceImpl implements HotlineCaseService { - - @Resource - private HotlineCaseMapper mapper; - @Resource(name = "hotlineFileMapper") - private HotlineFileMapper fileMapper; - @Resource - private SysPhotoMapper photoMapper; - - @Override - public PageResult selectPage(PageParam pageParam, HotlineCaseDO where) { - return mapper.selectPage(pageParam, where); - } - - @Override - public HotlineCaseDO selectById(String id) { - return mapper.selectById(id); - } - - @Override - public Boolean insert(HotlineCaseDO entity) { - return mapper.insert(entity) > 0; - } - - @Override - public Boolean update(HotlineCaseDO entity) { - return mapper.updateById(entity) > 0; - } - - @Override - public Boolean deleteByIds(List ids) { - return mapper.deleteBatchIds(ids) > 0; - } - - @Override - public com.zteits.urbanops.module.garden.controller.admin.hotline.vo.HotlineCaseDetailResp getDetail(String id) { - com.zteits.urbanops.module.garden.controller.admin.hotline.vo.HotlineCaseDetailResp resp = new com.zteits.urbanops.module.garden.controller.admin.hotline.vo.HotlineCaseDetailResp(); - resp.setCaseInfo(mapper.selectById(id)); - HotlineFileDO whereFile = new HotlineFileDO(); - whereFile.setCaseid(id); - java.util.List files = fileMapper.selectList(whereFile); - resp.setFiles(files); - SysPhotoDO wherePhoto = new SysPhotoDO(); - java.util.List photos = photoMapper.selectList(wherePhoto); - resp.setPhotos(photos); - return resp; - } -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/hotline/HotlineFileService.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/hotline/HotlineFileService.java deleted file mode 100644 index 70c880d..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/hotline/HotlineFileService.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.zteits.urbanops.module.garden.service.hotline; - -import com.zteits.urbanops.module.garden.dal.dataobject.hotline.HotlineFileDO; -import org.springframework.web.multipart.MultipartFile; - -import java.util.List; - -public interface HotlineFileService { - Object parseFile(MultipartFile file) throws Exception; - List selectList(HotlineFileDO where); - HotlineFileDO selectById(String caseid); - Boolean insert(HotlineFileDO entity); - Boolean update(HotlineFileDO entity); - Boolean deleteByIds(List ids); -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/hotline/HotlineFileServiceImpl.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/hotline/HotlineFileServiceImpl.java deleted file mode 100644 index fbe9b30..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/hotline/HotlineFileServiceImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.zteits.urbanops.module.garden.service.hotline; - -import com.zteits.urbanops.module.garden.dal.dataobject.hotline.HotlineFileDO; -import com.zteits.urbanops.module.garden.dal.mysql.hotline.HotlineFileMapper; -import jakarta.annotation.Resource; -import org.springframework.stereotype.Service; -import org.springframework.web.multipart.MultipartFile; - -import java.util.List; - -@Service -public class HotlineFileServiceImpl implements HotlineFileService { - - @Resource - private HotlineFileMapper mapper; - - @Override - public Object parseFile(MultipartFile file) throws Exception { - return java.util.Collections.emptyMap(); - } - - @Override - public List selectList(HotlineFileDO where) { - return mapper.selectList(where); - } - - @Override - public HotlineFileDO selectById(String caseid) { - return mapper.selectById(caseid); - } - - @Override - public Boolean insert(HotlineFileDO entity) { - return mapper.insert(entity) > 0; - } - - @Override - public Boolean update(HotlineFileDO entity) { - return mapper.updateById(entity) > 0; - } - - @Override - public Boolean deleteByIds(List ids) { - return mapper.deleteBatchIds(ids) > 0; - } -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/hotlinecase/HotlineCaseService.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/hotlinecase/HotlineCaseService.java new file mode 100644 index 0000000..b1d317d --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/hotlinecase/HotlineCaseService.java @@ -0,0 +1,62 @@ +package com.zteits.urbanops.module.garden.service.hotlinecase; + +import java.util.*; +import jakarta.validation.*; +import com.zteits.urbanops.module.garden.controller.admin.hotlinecase.vo.*; +import com.zteits.urbanops.module.garden.dal.dataobject.hotlinecase.HotlineCaseDO; +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.common.pojo.PageParam; + +/** + * 12345案件信息 Service 接口 + * + * @author 超级管理员 + */ +public interface HotlineCaseService { + + /** + * 创建12345案件信息 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + String createHotlineCase(@Valid HotlineCaseSaveReqVO createReqVO); + + /** + * 更新12345案件信息 + * + * @param updateReqVO 更新信息 + */ + void updateHotlineCase(@Valid HotlineCaseSaveReqVO updateReqVO); + + /** + * 删除12345案件信息 + * + * @param id 编号 + */ + void deleteHotlineCase(String id); + + /** + * 批量删除12345案件信息 + * + * @param ids 编号 + */ + void deleteHotlineCaseListByIds(List ids); + + /** + * 获得12345案件信息 + * + * @param id 编号 + * @return 12345案件信息 + */ + HotlineCaseDO getHotlineCase(String id); + + /** + * 获得12345案件信息分页 + * + * @param pageReqVO 分页查询 + * @return 12345案件信息分页 + */ + PageResult getHotlineCasePage(HotlineCasePageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/hotlinecase/HotlineCaseServiceImpl.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/hotlinecase/HotlineCaseServiceImpl.java new file mode 100644 index 0000000..0d1567c --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/hotlinecase/HotlineCaseServiceImpl.java @@ -0,0 +1,80 @@ +package com.zteits.urbanops.module.garden.service.hotlinecase; + +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.common.util.object.BeanUtils; +import com.zteits.urbanops.module.garden.controller.admin.hotlinecase.vo.HotlineCasePageReqVO; +import com.zteits.urbanops.module.garden.controller.admin.hotlinecase.vo.HotlineCaseSaveReqVO; +import com.zteits.urbanops.module.garden.dal.dataobject.hotlinecase.HotlineCaseDO; +import com.zteits.urbanops.module.garden.dal.mysql.hotlinecase.HotlineCaseMapper; +import jakarta.annotation.Resource; +import org.springframework.stereotype.Service; +import org.springframework.validation.annotation.Validated; + +import java.util.List; + +import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zteits.urbanops.module.garden.enums.ErrorCodeConstants.HOTLINE_CASE_NOT_EXISTS; + +/** + * 12345案件信息 Service 实现类 + * + * @author 超级管理员 + */ +@Service +@Validated +public class HotlineCaseServiceImpl implements HotlineCaseService { + + @Resource + private HotlineCaseMapper hotlineCaseMapper; + + @Override + public String createHotlineCase(HotlineCaseSaveReqVO createReqVO) { + // 插入 + HotlineCaseDO hotlineCase = BeanUtils.toBean(createReqVO, HotlineCaseDO.class); + hotlineCaseMapper.insert(hotlineCase); + + // 返回 + return hotlineCase.getId(); + } + + @Override + public void updateHotlineCase(HotlineCaseSaveReqVO updateReqVO) { + // 校验存在 + validateHotlineCaseExists(updateReqVO.getId()); + // 更新 + HotlineCaseDO updateObj = BeanUtils.toBean(updateReqVO, HotlineCaseDO.class); + hotlineCaseMapper.updateById(updateObj); + } + + @Override + public void deleteHotlineCase(String id) { + // 校验存在 + validateHotlineCaseExists(id); + // 删除 + hotlineCaseMapper.deleteById(id); + } + + @Override + public void deleteHotlineCaseListByIds(List ids) { + // 删除 + hotlineCaseMapper.deleteByIds(ids); + } + + + private void validateHotlineCaseExists(String id) { + if (hotlineCaseMapper.selectById(id) == null) { + throw exception(HOTLINE_CASE_NOT_EXISTS); + } + } + + @Override + public HotlineCaseDO getHotlineCase(String id) { + return hotlineCaseMapper.selectById(id); + } + + @Override + public PageResult getHotlineCasePage(HotlineCasePageReqVO pageReqVO) { + return hotlineCaseMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/hotlinefile/HotlineFileService.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/hotlinefile/HotlineFileService.java new file mode 100644 index 0000000..23e7827 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/hotlinefile/HotlineFileService.java @@ -0,0 +1,62 @@ +package com.zteits.urbanops.module.garden.service.hotlinefile; + +import java.util.*; +import jakarta.validation.*; +import com.zteits.urbanops.module.garden.controller.admin.hotlinefile.vo.*; +import com.zteits.urbanops.module.garden.dal.dataobject.hotlinefile.HotlineFileDO; +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.common.pojo.PageParam; + +/** + * 12345案件-文件 Service 接口 + * + * @author 超级管理员 + */ +public interface HotlineFileService { + + /** + * 创建12345案件-文件 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + String createHotlineFile(@Valid HotlineFileSaveReqVO createReqVO); + + /** + * 更新12345案件-文件 + * + * @param updateReqVO 更新信息 + */ + void updateHotlineFile(@Valid HotlineFileSaveReqVO updateReqVO); + + /** + * 删除12345案件-文件 + * + * @param id 编号 + */ + void deleteHotlineFile(String id); + + /** + * 批量删除12345案件-文件 + * + * @param ids 编号 + */ + void deleteHotlineFileListByIds(List ids); + + /** + * 获得12345案件-文件 + * + * @param id 编号 + * @return 12345案件-文件 + */ + HotlineFileDO getHotlineFile(String id); + + /** + * 获得12345案件-文件分页 + * + * @param pageReqVO 分页查询 + * @return 12345案件-文件分页 + */ + PageResult getHotlineFilePage(HotlineFilePageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/hotlinefile/HotlineFileServiceImpl.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/hotlinefile/HotlineFileServiceImpl.java new file mode 100644 index 0000000..6d69b32 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/hotlinefile/HotlineFileServiceImpl.java @@ -0,0 +1,85 @@ +package com.zteits.urbanops.module.garden.service.hotlinefile; + +import cn.hutool.core.collection.CollUtil; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import com.zteits.urbanops.module.garden.controller.admin.hotlinefile.vo.*; +import com.zteits.urbanops.module.garden.dal.dataobject.hotlinefile.HotlineFileDO; +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.common.pojo.PageParam; +import com.zteits.urbanops.framework.common.util.object.BeanUtils; + +import com.zteits.urbanops.module.garden.dal.mysql.hotlinefile.HotlineFileMapper; + +import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.convertList; +import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.diffList; +import static com.zteits.urbanops.module.garden.enums.ErrorCodeConstants.*; + +/** + * 12345案件-文件 Service 实现类 + * + * @author 超级管理员 + */ +@Service +@Validated +public class HotlineFileServiceImpl implements HotlineFileService { + + @Resource + private HotlineFileMapper hotlineFileMapper; + + @Override + public String createHotlineFile(HotlineFileSaveReqVO createReqVO) { + // 插入 + HotlineFileDO hotlineFile = BeanUtils.toBean(createReqVO, HotlineFileDO.class); + hotlineFileMapper.insert(hotlineFile); + + // 返回 + return hotlineFile.getFileid(); + } + + @Override + public void updateHotlineFile(HotlineFileSaveReqVO updateReqVO) { + // 校验存在 + validateHotlineFileExists(updateReqVO.getFileid()); + // 更新 + HotlineFileDO updateObj = BeanUtils.toBean(updateReqVO, HotlineFileDO.class); + hotlineFileMapper.updateById(updateObj); + } + + @Override + public void deleteHotlineFile(String id) { + // 校验存在 + validateHotlineFileExists(id); + // 删除 + hotlineFileMapper.deleteById(id); + } + + @Override + public void deleteHotlineFileListByIds(List ids) { + // 删除 + hotlineFileMapper.deleteByIds(ids); + } + + + private void validateHotlineFileExists(String id) { + if (hotlineFileMapper.selectById(id) == null) { + throw exception(HOTLINE_FILE_NOT_EXISTS); + } + } + + @Override + public HotlineFileDO getHotlineFile(String id) { + return hotlineFileMapper.selectById(id); + } + + @Override + public PageResult getHotlineFilePage(HotlineFilePageReqVO pageReqVO) { + return hotlineFileMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/maintainrate/MaintainRateService.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/maintainrate/MaintainRateService.java deleted file mode 100644 index 648872c..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/maintainrate/MaintainRateService.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.zteits.urbanops.module.garden.service.maintainrate; - -import com.zteits.urbanops.framework.common.pojo.PageResult; -import com.zteits.urbanops.module.garden.controller.admin.maintainrate.vo.MaintainRatePageReqVO; -import com.zteits.urbanops.module.garden.controller.admin.maintainrate.vo.MaintainRateReqVO; -import com.zteits.urbanops.module.garden.controller.admin.maintainrate.vo.MaintainRateRespVO; -import com.zteits.urbanops.module.garden.dal.dataobject.maintainrate.MaintainRateDO; - -public interface MaintainRateService { - - PageResult selectPage(MaintainRatePageReqVO reqVO); - - MaintainRateDO selectById(Long id); - - Boolean insert(MaintainRateDO entity); - - Boolean update(MaintainRateDO entity); - - Boolean deleteById(Long id); - - MaintainRateRespVO getMaintainRateValue(MaintainRateReqVO reqVO); - - MaintainRateRespVO selectMaintainRateByLevel(Integer maintainTypeId, Integer level); -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/maintainrate/MaintainRateServiceImpl.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/maintainrate/MaintainRateServiceImpl.java deleted file mode 100644 index 157ec69..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/maintainrate/MaintainRateServiceImpl.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.zteits.urbanops.module.garden.service.maintainrate; - -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.zteits.urbanops.framework.common.pojo.PageResult; -import com.zteits.urbanops.module.garden.controller.admin.maintainrate.vo.MaintainRatePageReqVO; -import com.zteits.urbanops.module.garden.controller.admin.maintainrate.vo.MaintainRateReqVO; -import com.zteits.urbanops.module.garden.controller.admin.maintainrate.vo.MaintainRateRespVO; -import com.zteits.urbanops.module.garden.dal.dataobject.maintainrate.MaintainRateDO; -import com.zteits.urbanops.module.garden.dal.mysql.maintainrate.MaintainRateMapper; -import jakarta.annotation.Resource; -import org.springframework.stereotype.Service; -import org.springframework.validation.annotation.Validated; - -@Service -@Validated -public class MaintainRateServiceImpl implements MaintainRateService { - - @Resource - private MaintainRateMapper maintainRateMapper; - - @Override - public PageResult selectPage(MaintainRatePageReqVO reqVO) { - return maintainRateMapper.selectPage(reqVO); - } - - @Override - public MaintainRateDO selectById(Long id) { - return maintainRateMapper.selectById(id); - } - - @Override - public Boolean insert(MaintainRateDO entity) { - return maintainRateMapper.insert(entity) > 0; - } - - @Override - public Boolean update(MaintainRateDO entity) { - return maintainRateMapper.updateById(entity) > 0; - } - - @Override - public Boolean deleteById(Long id) { - return maintainRateMapper.deleteById(id) > 0; - } - - @Override - public MaintainRateRespVO getMaintainRateValue(MaintainRateReqVO reqVO) { - LambdaQueryWrapper qw = Wrappers.lambdaQuery(); - qw.eq(MaintainRateDO::getMaintainSubjectId, reqVO.getMaintainSubjectId()); - qw.eq(MaintainRateDO::getMaintainTypeId, reqVO.getMaintainTypeId()); - qw.orderByDesc(MaintainRateDO::getId); - MaintainRateDO rate = maintainRateMapper.selectOne(qw); - if (rate == null) { - return null; - } - MaintainRateRespVO resp = new MaintainRateRespVO(); - resp.setMaintainTypeId(rate.getMaintainTypeId()); - resp.setMaintainTypeName(rate.getMaintainTypeName()); - resp.setCycleId(rate.getCycleId()); - resp.setCycleName(rate.getCycleName()); - resp.setLevelTop(rate.getLevelTop()); - resp.setLevelOne(rate.getLevelOne()); - resp.setLevelTwo(rate.getLevelTwo()); - resp.setLevelThree(rate.getLevelThree()); - return resp; - } - - @Override - public MaintainRateRespVO selectMaintainRateByLevel(Integer maintainTypeId, Integer level) { - LambdaQueryWrapper qw = Wrappers.lambdaQuery(); - qw.eq(MaintainRateDO::getMaintainTypeId, maintainTypeId); - qw.orderByDesc(MaintainRateDO::getId); - MaintainRateDO rate = maintainRateMapper.selectOne(qw); - if (rate == null) { - return null; - } - MaintainRateRespVO resp = new MaintainRateRespVO(); - resp.setMaintainTypeId(rate.getMaintainTypeId()); - resp.setMaintainTypeName(rate.getMaintainTypeName()); - resp.setCycleId(rate.getCycleId()); - resp.setCycleName(rate.getCycleName()); - String value; - if (level != null && level == 10) { - value = rate.getLevelTop(); - } else if (level != null && level == 11) { - value = rate.getLevelOne(); - } else if (level != null && level == 12) { - value = rate.getLevelTwo(); - } else { - value = rate.getLevelThree(); - } - resp.setValue(value); - return resp; - } -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialInventoryService.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialInventoryService.java deleted file mode 100644 index d2615e1..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialInventoryService.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.zteits.urbanops.module.garden.service.material; - -import com.zteits.urbanops.framework.common.pojo.PageParam; -import com.zteits.urbanops.framework.common.pojo.PageResult; -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialInventoryDO; - -public interface MaterialInventoryService { - PageResult selectPage(PageParam pageParam, MaterialInventoryDO where); - Boolean updateInventoryAlarmNum(Long materialId, Long alermNum); -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialInventoryServiceImpl.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialInventoryServiceImpl.java deleted file mode 100644 index 9327c7c..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialInventoryServiceImpl.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.zteits.urbanops.module.garden.service.material; - -import com.zteits.urbanops.framework.common.pojo.PageParam; -import com.zteits.urbanops.framework.common.pojo.PageResult; -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialInventoryDO; -import com.zteits.urbanops.module.garden.dal.mysql.material.MaterialInventoryMapper; -import jakarta.annotation.Resource; -import org.springframework.stereotype.Service; - -@Service -public class MaterialInventoryServiceImpl implements MaterialInventoryService { - - @Resource - private MaterialInventoryMapper mapper; - - @Override - public PageResult selectPage(PageParam pageParam, MaterialInventoryDO where) { - return mapper.selectPage(pageParam, null, new com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX() - .eqIfPresent(MaterialInventoryDO::getMaterialId, where.getMaterialId()) - .likeIfPresent(MaterialInventoryDO::getMaterialName, where.getMaterialName()) - .eqIfPresent(MaterialInventoryDO::getTypeDetailId, where.getTypeDetailId()) - .eqIfPresent(MaterialInventoryDO::getBelongCompanyId, where.getBelongCompanyId()) - .orderByDesc(MaterialInventoryDO::getUpdateTime)); - } - - @Override - public Boolean updateInventoryAlarmNum(Long materialId, Long alermNum) { - return mapper.updateInventoryAlarmNum(materialId, alermNum) > 0; - } -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialService.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialService.java index ae2a243..f07e8db 100644 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialService.java +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialService.java @@ -1,7 +1,62 @@ package com.zteits.urbanops.module.garden.service.material; +import java.util.*; +import jakarta.validation.*; +import com.zteits.urbanops.module.garden.controller.admin.material.vo.*; import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialDO; +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.common.pojo.PageParam; +/** + * 耗材管理 Service 接口 + * + * @author 超级管理员 + */ public interface MaterialService { - MaterialDO selectById(Long id); + + /** + * 创建耗材管理 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createMaterial(@Valid MaterialSaveReqVO createReqVO); + + /** + * 更新耗材管理 + * + * @param updateReqVO 更新信息 + */ + void updateMaterial(@Valid MaterialSaveReqVO updateReqVO); + + /** + * 删除耗材管理 + * + * @param id 编号 + */ + void deleteMaterial(Long id); + + /** + * 批量删除耗材管理 + * + * @param ids 编号 + */ + void deleteMaterialListByIds(List ids); + + /** + * 获得耗材管理 + * + * @param id 编号 + * @return 耗材管理 + */ + MaterialDO getMaterial(Long id); + + /** + * 获得耗材管理分页 + * + * @param pageReqVO 分页查询 + * @return 耗材管理分页 + */ + PageResult getMaterialPage(MaterialPageReqVO pageReqVO); + } \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialServiceImpl.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialServiceImpl.java index 88a0ff9..eecf2c5 100644 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialServiceImpl.java +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialServiceImpl.java @@ -1,17 +1,95 @@ package com.zteits.urbanops.module.garden.service.material; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; + +import java.util.*; +import com.zteits.urbanops.module.garden.controller.admin.material.vo.*; import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialDO; +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.common.util.object.BeanUtils; + import com.zteits.urbanops.module.garden.dal.mysql.material.MaterialMapper; -import jakarta.annotation.Resource; -import org.springframework.stereotype.Service; +import static com.zteits.urbanops.framework.common.exception.enums.GlobalErrorCodeConstants.BAD_REQUEST; +import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception0; +import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.convertList; +import static com.zteits.urbanops.module.garden.enums.ErrorCodeConstants.*; + +/** + * 耗材管理 Service 实现类 + * + * @author 超级管理员 + */ @Service +@Validated public class MaterialServiceImpl implements MaterialService { + @Resource private MaterialMapper materialMapper; @Override - public MaterialDO selectById(Long id) { + public Long createMaterial(MaterialSaveReqVO createReqVO) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(MaterialDO::getMaterialCode, createReqVO.getMaterialCode()) + .eq(MaterialDO::getSpecCode, createReqVO.getSpecCode()) + .eq(MaterialDO::getMaterialTypeId, createReqVO.getTypeDetailId()); + List tdMaterials = materialMapper.selectList(queryWrapper); + if (null != tdMaterials && tdMaterials.size() > 0) { + MaterialDO material = tdMaterials.get(0); + throw exception0(BAD_REQUEST.getCode(), "名称:"+material.getMaterialName()+",规格:"+material.getSpecifications() +",类别明细:"+material.getTypeDetailName()+ " 的物料已存在"); + } + + createReqVO.setFullCode(createReqVO.getTypeDetailId()+createReqVO.getMaterialCode()+createReqVO.getSpecCode()); + // 插入 + MaterialDO material = BeanUtils.toBean(createReqVO, MaterialDO.class); + materialMapper.insert(material); + + // 返回 + return material.getMaterialId(); + } + + @Override + public void updateMaterial(MaterialSaveReqVO updateReqVO) { + // 校验存在 + validateMaterialExists(updateReqVO.getMaterialId()); + // 更新 + MaterialDO updateObj = BeanUtils.toBean(updateReqVO, MaterialDO.class); + materialMapper.updateById(updateObj); + } + + @Override + public void deleteMaterial(Long id) { + // 校验存在 + validateMaterialExists(id); + // 删除 + materialMapper.deleteById(id); + } + + @Override + public void deleteMaterialListByIds(List ids) { + // 删除 + materialMapper.deleteByIds(ids); + } + + + private void validateMaterialExists(Long id) { + if (materialMapper.selectById(id) == null) { + throw exception(MATERIAL_NOT_EXISTS); + } + } + + @Override + public MaterialDO getMaterial(Long id) { return materialMapper.selectById(id); } -} \ No newline at end of file + + @Override + public PageResult getMaterialPage(MaterialPageReqVO pageReqVO) { + return materialMapper.selectPage(pageReqVO); + } + +} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialTypeService.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialTypeService.java deleted file mode 100644 index 807718a..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialTypeService.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.zteits.urbanops.module.garden.service.material; - -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.zteits.urbanops.module.garden.controller.business.vo.MaterialTypeManagerRespVO; -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialTypeDO; - -import java.util.List; - -public interface MaterialTypeService { - - MaterialTypeDO get(Long id); - - List selectList(MaterialTypeDO req); - - Page selectPage(Page page, MaterialTypeDO req); - - boolean insert(MaterialTypeDO entity); - - boolean update(MaterialTypeDO entity); - - boolean deleteById(Long id); - - List queryMaterialBigType(Long materialTypeId); - - List queryMaterialMidType(Long materialTypeId); - - List queryMaterialDetailType(Long parentTypeId); - - Long selectMaxTypeDetailId(Long materialTypeId, Long typeId); -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialTypeServiceImpl.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialTypeServiceImpl.java deleted file mode 100644 index 31235d9..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialTypeServiceImpl.java +++ /dev/null @@ -1,125 +0,0 @@ -package com.zteits.urbanops.module.garden.service.material; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.zteits.urbanops.module.garden.controller.business.vo.MaterialTypeManagerRespVO; -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialTypeDO; -import com.zteits.urbanops.module.garden.dal.mysql.material.MaterialTypeMapper; -import jakarta.annotation.Resource; -import org.springframework.stereotype.Service; - -import java.util.List; - -@Service -public class MaterialTypeServiceImpl implements MaterialTypeService { - - @Resource - private MaterialTypeMapper mapper; - - @Override - public MaterialTypeDO get(Long id) { - return mapper.selectById(id); - } - - @Override - public List selectList(MaterialTypeDO req) { - com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX wrapper = - new com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX() - .likeIfPresent(MaterialTypeDO::getTypeName, req.getTypeName()) - .eqIfPresent(MaterialTypeDO::getParentId, req.getParentId()) - .eqIfPresent(MaterialTypeDO::getLevel, req.getLevel()) - .orderByDesc(MaterialTypeDO::getId); - return mapper.selectList(wrapper); - } - - @Override - public Page selectPage(Page page, MaterialTypeDO req) { - com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX wrapper = - new com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX() - .likeIfPresent(MaterialTypeDO::getTypeName, req.getTypeName()) - .eqIfPresent(MaterialTypeDO::getParentId, req.getParentId()) - .eqIfPresent(MaterialTypeDO::getLevel, req.getLevel()) - .orderByDesc(MaterialTypeDO::getId); - return mapper.selectPage(page, wrapper); - } - - @Override - public boolean insert(MaterialTypeDO entity) { - entity.clean(); - return mapper.insert(entity) > 0; - } - - @Override - public boolean update(MaterialTypeDO entity) { - entity.clean(); - return mapper.updateById(entity) > 0; - } - - @Override - public boolean deleteById(Long id) { - return mapper.deleteById(id) > 0; - } - - @Override - public List queryMaterialBigType(Long materialTypeId) { - com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX wrapper = - new com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX() - .eqIfPresent(MaterialTypeDO::getLevel, 1) - .orderByDesc(MaterialTypeDO::getId); - List list = mapper.selectList(wrapper); - return list.stream().filter(it -> materialTypeId == null || !it.getId().equals(materialTypeId)) - .map(it -> { - MaterialTypeManagerRespVO vo = new MaterialTypeManagerRespVO(); - vo.setValue(it.getId()); - vo.setLabel(it.getTypeName()); - return vo; - }).toList(); - } - - @Override - public List queryMaterialMidType(Long materialTypeId) { - com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX wrapper = - new com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX() - .eqIfPresent(MaterialTypeDO::getLevel, 2) - .eqIfPresent(MaterialTypeDO::getParentId, materialTypeId) - .orderByDesc(MaterialTypeDO::getId); - List list = mapper.selectList(wrapper); - return list.stream().map(it -> { - MaterialTypeManagerRespVO vo = new MaterialTypeManagerRespVO(); - vo.setValue(it.getId()); - vo.setLabel(it.getTypeName()); - vo.setMaterialParentTypeId(it.getParentId()); - return vo; - }).toList(); - } - - @Override - public List queryMaterialDetailType(Long parentTypeId) { - com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX wrapper = - new com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX() - .eqIfPresent(MaterialTypeDO::getLevel, 3) - .eqIfPresent(MaterialTypeDO::getParentId, parentTypeId) - .orderByDesc(MaterialTypeDO::getId); - List list = mapper.selectList(wrapper); - return list.stream().map(it -> { - MaterialTypeManagerRespVO vo = new MaterialTypeManagerRespVO(); - vo.setValue(it.getId()); - vo.setLabel(it.getTypeName()); - vo.setParentTypeId(it.getParentId()); - return vo; - }).toList(); - } - - @Override - public Long selectMaxTypeDetailId(Long materialTypeId, Long typeId) { - QueryWrapper qw = new QueryWrapper<>(); - qw.select("max(id) AS maxId") - .eq("level", 3) - .eq("parent_id", typeId); - List> maps = mapper.selectMaps(qw); - if (maps.isEmpty() || maps.get(0).get("maxId") == null) { - return 0L; - } - return ((Number) maps.get(0).get("maxId")).longValue(); - } -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventory/MaterialInventoryService.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventory/MaterialInventoryService.java new file mode 100644 index 0000000..7d09864 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventory/MaterialInventoryService.java @@ -0,0 +1,101 @@ +package com.zteits.urbanops.module.garden.service.materialinventory; + +import java.util.*; +import jakarta.validation.*; +import com.zteits.urbanops.module.garden.controller.admin.materialinventory.vo.*; +import com.zteits.urbanops.module.garden.dal.dataobject.materialinventory.MaterialInventoryDO; +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.common.pojo.PageParam; + +/** + * 物料库存 Service 接口 + * + * @author 超级管理员 + */ +public interface MaterialInventoryService { + + /** + * 创建物料库存 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createMaterialInventory(@Valid MaterialInventorySaveReqVO createReqVO); + + /** + * 更新物料库存 + * + * @param updateReqVO 更新信息 + */ + void updateMaterialInventory(@Valid MaterialInventorySaveReqVO updateReqVO); + + /** + * 删除物料库存 + * + * @param id 编号 + */ + void deleteMaterialInventory(Long id); + + /** + * 批量删除物料库存 + * + * @param ids 编号 + */ + void deleteMaterialInventoryListByIds(List ids); + + /** + * 获得物料库存 + * + * @param id 编号 + * @return 物料库存 + */ + MaterialInventoryDO getMaterialInventory(Long id); + + /** + * 获得物料库存分页 + * + * @param pageReqVO 分页查询 + * @return 物料库存分页 + */ + PageResult getMaterialInventoryPage(MaterialInventoryPageReqVO pageReqVO); + + + /** + * 新增物料库存 + * + * @param materialInventory 物料库存 + * @return 结果 + */ + public int insertMaterialInventory(MaterialInventoryDO materialInventory); + /** + * 更新物料库存 + * + * @param materialInventory 物料库存 + * @return 结果 + */ + public int updateTdMaterialInventory(MaterialInventoryDO materialInventory); + /** + * @Author wangqian + * @Description 查询物料信息根据 + * @Date 2025/11/28 23:36 + * @Param materialId + */ + MaterialInventoryDO selectTdMaterialInventoryByMaterialId(Long materialId); + + + /** + * 更新出库库库存信息 + * @param materialInventory + * @param outNum 出库数量 + * @return + */ + int updateInVentoryByMaterialId(MaterialInventoryDO materialInventory, Long outNum); + + /** + * 更新出库库库存信息 + * @param materialId + * @param alermNum 库存预警 + * @return + */ + int updateInVentoryAlremNum(Long materialId, Long alermNum); +} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventory/MaterialInventoryServiceImpl.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventory/MaterialInventoryServiceImpl.java new file mode 100644 index 0000000..9afb0d3 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventory/MaterialInventoryServiceImpl.java @@ -0,0 +1,148 @@ +package com.zteits.urbanops.module.garden.service.materialinventory; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.common.util.object.BeanUtils; +import com.zteits.urbanops.module.garden.controller.admin.materialinventory.vo.MaterialInventoryPageReqVO; +import com.zteits.urbanops.module.garden.controller.admin.materialinventory.vo.MaterialInventorySaveReqVO; +import com.zteits.urbanops.module.garden.dal.dataobject.materialinventory.MaterialInventoryDO; +import com.zteits.urbanops.module.garden.dal.mysql.materialinventory.MaterialInventoryMapper; +import jakarta.annotation.Resource; +import org.springframework.stereotype.Service; +import org.springframework.validation.annotation.Validated; + +import java.util.List; + +import static com.zteits.urbanops.framework.common.exception.enums.GlobalErrorCodeConstants.BAD_REQUEST; +import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception0; +import static com.zteits.urbanops.module.garden.enums.ErrorCodeConstants.MATERIAL_INVENTORY_NOT_EXISTS; + +/** + * 物料库存 Service 实现类 + * + * @author 超级管理员 + */ +@Service +@Validated +public class MaterialInventoryServiceImpl implements MaterialInventoryService { + + @Resource + private MaterialInventoryMapper materialInventoryMapper; + + @Override + public Long createMaterialInventory(MaterialInventorySaveReqVO createReqVO) { + // 插入 + MaterialInventoryDO materialInventory = BeanUtils.toBean(createReqVO, MaterialInventoryDO.class); + materialInventoryMapper.insert(materialInventory); + + // 返回 + return materialInventory.getMaterialId(); + } + + @Override + public void updateMaterialInventory(MaterialInventorySaveReqVO updateReqVO) { + // 校验存在 + validateMaterialInventoryExists(updateReqVO.getMaterialId()); + // 更新 + MaterialInventoryDO updateObj = BeanUtils.toBean(updateReqVO, MaterialInventoryDO.class); + materialInventoryMapper.updateById(updateObj); + } + + @Override + public void deleteMaterialInventory(Long id) { + // 校验存在 + validateMaterialInventoryExists(id); + // 删除 + materialInventoryMapper.deleteById(id); + } + + @Override + public void deleteMaterialInventoryListByIds(List ids) { + // 删除 + materialInventoryMapper.deleteByIds(ids); + } + + + private void validateMaterialInventoryExists(Long id) { + if (materialInventoryMapper.selectById(id) == null) { + throw exception(MATERIAL_INVENTORY_NOT_EXISTS); + } + } + + @Override + public MaterialInventoryDO getMaterialInventory(Long id) { + return materialInventoryMapper.selectById(id); + } + + @Override + public PageResult getMaterialInventoryPage(MaterialInventoryPageReqVO pageReqVO) { + return materialInventoryMapper.selectPage(pageReqVO); + } + + @Override + public int insertMaterialInventory(MaterialInventoryDO materialInventory) { + LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery(); + queryWrapper.eq(MaterialInventoryDO::getBelongCompanyId, materialInventory.getBelongCompanyId()); + queryWrapper.eq(MaterialInventoryDO::getTypeDetailId, materialInventory.getTypeDetailId()); + MaterialInventoryDO object = materialInventoryMapper.selectOne(queryWrapper); + if(object != null){ + object.setInventoryTotalNum(object.getInventoryTotalNum()+ materialInventory.getCurrentNum()); + object.setCurrentNum(object.getCurrentNum()+materialInventory.getCurrentNum()); + return materialInventoryMapper.updateById(object); + } else { + return materialInventoryMapper.insert(materialInventory); + } + } + @Override + public int updateTdMaterialInventory(MaterialInventoryDO materialInventory) { + // 校验存在 + validateMaterialInventoryExists(materialInventory.getInventoryId()); + + return materialInventoryMapper.updateById(materialInventory); + } + + @Override + public MaterialInventoryDO selectTdMaterialInventoryByMaterialId(Long materialId) { + if (materialId == null) { + throw exception0(BAD_REQUEST.getCode(),"更新库存失败:materialId为空!"); + } + LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery(); + queryWrapper.eq(MaterialInventoryDO::getTypeDetailId, materialId); + return materialInventoryMapper.selectOne(queryWrapper); + } + + @Override + public int updateInVentoryByMaterialId(MaterialInventoryDO materialInventory, Long outNum) { + // 1. 入参空值校验(避免无效更新或SQL异常) + if (outNum == null) { + throw exception0(BAD_REQUEST.getCode(),"更新库存失败:outNum为空!"); + } + MaterialInventoryDO out = new MaterialInventoryDO(); + out.setInventoryId(materialInventory.getInventoryId()); + out.setOutTotalNum(materialInventory.getInventoryTotalNum() + outNum); + out.setCurrentNum(materialInventory.getCurrentNum() - outNum); + return materialInventoryMapper.updateById(materialInventory); + } + + @Override + public int updateInVentoryAlremNum(Long materialId, Long alermNum) { + // 1. 入参空值校验(避免无效更新或SQL异常) + if (materialId == null || alermNum == null) { + throw exception0(BAD_REQUEST.getCode(),"更新库存预警数失败:materialId或alermNum为空!"); + } + + // 2. 构造更新条件:用LambdaUpdateWrapper(专用于更新操作,语义更清晰) + LambdaUpdateWrapper updateWrapper = Wrappers.lambdaUpdate(); + // 设置要更新的字段:inventoryAlremNum = alermNum + updateWrapper.set(MaterialInventoryDO::getInventoryAlermNum, alermNum) + // 设置更新条件:根据materialId匹配记录(若实际条件是typeDetailId,替换为getTypeDetailId即可) + .eq(MaterialInventoryDO::getMaterialId, materialId); + + // 3. 执行更新(MyBatis-Plus支持直接传wrapper,第一个参数为null即可) + return materialInventoryMapper.update(null, updateWrapper); + } +} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventoryin/MaterialInventoryInService.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventoryin/MaterialInventoryInService.java new file mode 100644 index 0000000..e5b5727 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventoryin/MaterialInventoryInService.java @@ -0,0 +1,62 @@ +package com.zteits.urbanops.module.garden.service.materialinventoryin; + +import java.util.*; +import jakarta.validation.*; +import com.zteits.urbanops.module.garden.controller.admin.materialinventoryin.vo.*; +import com.zteits.urbanops.module.garden.dal.dataobject.materialinventoryin.MaterialInventoryInDO; +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.common.pojo.PageParam; + +/** + * 物料入库 Service 接口 + * + * @author 超级管理员 + */ +public interface MaterialInventoryInService { + + /** + * 创建物料入库 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createMaterialInventoryIn(@Valid MaterialInventoryInSaveReqVO createReqVO); + + /** + * 更新物料入库 + * + * @param updateReqVO 更新信息 + */ + void updateMaterialInventoryIn(@Valid MaterialInventoryInSaveReqVO updateReqVO); + + /** + * 删除物料入库 + * + * @param id 编号 + */ + void deleteMaterialInventoryIn(Long id); + + /** + * 批量删除物料入库 + * + * @param ids 编号 + */ + void deleteMaterialInventoryInListByIds(List ids); + + /** + * 获得物料入库 + * + * @param id 编号 + * @return 物料入库 + */ + MaterialInventoryInDO getMaterialInventoryIn(Long id); + + /** + * 获得物料入库分页 + * + * @param pageReqVO 分页查询 + * @return 物料入库分页 + */ + PageResult getMaterialInventoryInPage(MaterialInventoryInPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventoryin/MaterialInventoryInServiceImpl.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventoryin/MaterialInventoryInServiceImpl.java new file mode 100644 index 0000000..bedf767 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventoryin/MaterialInventoryInServiceImpl.java @@ -0,0 +1,183 @@ +package com.zteits.urbanops.module.garden.service.materialinventoryin; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.RandomUtil; +import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialDO; +import com.zteits.urbanops.module.garden.dal.dataobject.materialinventory.MaterialInventoryDO; +import com.zteits.urbanops.module.garden.dal.mysql.material.MaterialMapper; +import com.zteits.urbanops.module.garden.service.materialinventory.MaterialInventoryService; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import com.zteits.urbanops.module.garden.controller.admin.materialinventoryin.vo.*; +import com.zteits.urbanops.module.garden.dal.dataobject.materialinventoryin.MaterialInventoryInDO; +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.common.pojo.PageParam; +import com.zteits.urbanops.framework.common.util.object.BeanUtils; + +import com.zteits.urbanops.module.garden.dal.mysql.materialinventoryin.MaterialInventoryInMapper; + +import static com.zteits.urbanops.framework.common.exception.enums.GlobalErrorCodeConstants.BAD_REQUEST; +import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception0; +import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.convertList; +import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.diffList; +import static com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils.getLoginUser; +import static com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils.getLoginUserDeptId; +import static com.zteits.urbanops.module.garden.enums.ErrorCodeConstants.*; + +/** + * 物料入库 Service 实现类 + * + * @author 超级管理员 + */ +@Service +@Validated +public class MaterialInventoryInServiceImpl implements MaterialInventoryInService { + + @Resource + private MaterialInventoryInMapper materialInventoryInMapper; + + @Resource + private MaterialMapper materialMapper; + + @Resource + private MaterialInventoryService materialInventoryService; + + @Override + @Transactional + public Long createMaterialInventoryIn(MaterialInventoryInSaveReqVO createReqVO) { + //参数校验 + MaterialDO material = materialMapper.selectOne(MaterialDO::getMaterialId,createReqVO.getMaterialId()); + if(null == material){ + throw exception0(BAD_REQUEST.getCode(), "无效参数-materialId"); + } + MaterialInventoryInDO in = new MaterialInventoryInDO(); + in.setInventoryInNo(System.currentTimeMillis()+ RandomUtil.randomInt(10, 100000)+""); + in.setMaterialId(createReqVO.getMaterialId()); + in.setMaterialName(material.getMaterialName()); + in.setMaterialTypeId(material.getMaterialTypeId()); + in.setMaterialTypeName(material.getMaterialTypeName()); + in.setTypeId(material.getTypeId()); + in.setTypeName(material.getTypeName()); + in.setTypeDetailId(material.getTypeDetailId()); + in.setTypeDetailName(material.getTypeDetailName()); + in.setSpecifications(material.getSpecifications()); + in.setBelongCompanyId(material.getBelongCompanyId()); + in.setBelongCompanyName(material.getBelongCompanyName()); + in.setInInventoryNum(createReqVO.getInInventoryNum()); + in.setMaterialPrice(createReqVO.getMaterialPrice()); + in.setUnitId(material.getUnitId()); + in.setUnitName(material.getUnitName()); + in.setBuyDate(createReqVO.getBuyDate()); + in.setSupplierName(createReqVO.getSupplierName()); + in.setContactsName(createReqVO.getContactsName()); + in.setContactsPhone(createReqVO.getContactsPhone()); + in.setDeptId(getLoginUserDeptId()); + + // 插入 + //MaterialInventoryInDO materialInventoryIn = BeanUtils.toBean(createReqVO, MaterialInventoryInDO.class); + materialInventoryInMapper.insert(in); + + //更新库存 + MaterialInventoryDO inventory = new MaterialInventoryDO(); + inventory.setMaterialId(in.getMaterialId()); + inventory.setMaterialName(in.getMaterialName()); + inventory.setMaterialTypeId(in.getMaterialTypeId()); + inventory.setMaterialTypeName(in.getMaterialTypeName()); + inventory.setTypeId(material.getTypeId()); + inventory.setTypeName(material.getTypeName()); + inventory.setTypeDetailId(material.getTypeDetailId()); + inventory.setTypeDetailName(material.getTypeDetailName()); + inventory.setSpecifications(in.getSpecifications()); + inventory.setBelongCompanyId(in.getBelongCompanyId()); + inventory.setBelongCompanyName(in.getBelongCompanyName()); + inventory.setUnitId(in.getUnitId()); + inventory.setUnitName(in.getUnitName()); + inventory.setCurrentNum(in.getInInventoryNum()); + inventory.setOutTotalNum(0L); + inventory.setInventoryTotalNum(in.getInInventoryNum()); + inventory.setDeptId(getLoginUserDeptId()); + materialInventoryService.insertMaterialInventory(inventory); + + // 返回 + return in.getId(); + } + + @Override + @Transactional + public void updateMaterialInventoryIn(MaterialInventoryInSaveReqVO updateReqVO) { + // 校验存在 + validateMaterialInventoryInExists(updateReqVO.getId()); + //查询库存管理参数 + MaterialDO material = materialMapper.selectOne(MaterialDO::getMaterialId,updateReqVO.getMaterialId()); + if(null == material){ + throw exception0(BAD_REQUEST.getCode(), "无效参数-materialId"); + } + // 更新 + MaterialInventoryInDO updateObj = BeanUtils.toBean(updateReqVO, MaterialInventoryInDO.class); + updateObj.setMaterialName(material.getMaterialName()); + updateObj.setMaterialTypeId(material.getMaterialTypeId()); + updateObj.setMaterialTypeName(material.getMaterialTypeName()); + updateObj.setSpecifications(material.getSpecifications()); + updateObj.setBelongCompanyId(material.getBelongCompanyId()); + updateObj.setBelongCompanyName(material.getBelongCompanyName()); + updateObj.setUnitId(material.getUnitId()); + updateObj.setUnitName(material.getUnitName()); + materialInventoryInMapper.updateById(updateObj); + } + + @Override + @Transactional + public void deleteMaterialInventoryIn(Long id) { + // 校验存在 + MaterialInventoryInDO materialInventoryIn = materialInventoryInMapper.selectById(id); + if (null == materialInventoryIn) { + throw exception(MATERIAL_INVENTORY_IN_NOT_EXISTS); + } + MaterialInventoryDO materialInventory = materialInventoryService.selectTdMaterialInventoryByMaterialId(materialInventoryIn.getMaterialId()); + if(null == materialInventory){ + throw exception0(BAD_REQUEST.getCode(),"参数错误"); + } + //库存已使用 + if(materialInventory.getCurrentNum() < materialInventoryIn.getInInventoryNum()){ + throw exception0(BAD_REQUEST.getCode(),"库存已使用"); + } + //入库记录减扣 + MaterialInventoryDO inventory = new MaterialInventoryDO(); + inventory.setInventoryId(materialInventory.getInventoryId()); + inventory.setMaterialId(materialInventory.getMaterialId()); + inventory.setCurrentNum(materialInventory.getCurrentNum() - materialInventoryIn.getInInventoryNum()); + inventory.setInventoryTotalNum(materialInventory.getInventoryTotalNum() - materialInventoryIn.getInInventoryNum()); + materialInventoryService.updateTdMaterialInventory(inventory); + // 删除 + materialInventoryInMapper.deleteById(id); + } + + @Override + public void deleteMaterialInventoryInListByIds(List ids) { + // 删除 + materialInventoryInMapper.deleteByIds(ids); + } + + + private void validateMaterialInventoryInExists(Long id) { + if (materialInventoryInMapper.selectById(id) == null) { + throw exception(MATERIAL_INVENTORY_IN_NOT_EXISTS); + } + } + + @Override + public MaterialInventoryInDO getMaterialInventoryIn(Long id) { + return materialInventoryInMapper.selectById(id); + } + + @Override + public PageResult getMaterialInventoryInPage(MaterialInventoryInPageReqVO pageReqVO) { + return materialInventoryInMapper.selectPage(pageReqVO); + } + +} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventoryout/MaterialInventoryOutService.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventoryout/MaterialInventoryOutService.java new file mode 100644 index 0000000..7030aea --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventoryout/MaterialInventoryOutService.java @@ -0,0 +1,62 @@ +package com.zteits.urbanops.module.garden.service.materialinventoryout; + +import java.util.*; +import jakarta.validation.*; +import com.zteits.urbanops.module.garden.controller.admin.materialinventoryout.vo.*; +import com.zteits.urbanops.module.garden.dal.dataobject.materialinventoryout.MaterialInventoryOutDO; +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.common.pojo.PageParam; + +/** + * 物料出库 Service 接口 + * + * @author 超级管理员 + */ +public interface MaterialInventoryOutService { + + /** + * 创建物料出库 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createMaterialInventoryOut(@Valid MaterialInventoryOutSaveReqVO createReqVO); + + /** + * 更新物料出库 + * + * @param updateReqVO 更新信息 + */ + void updateMaterialInventoryOut(@Valid MaterialInventoryOutSaveReqVO updateReqVO); + + /** + * 删除物料出库 + * + * @param id 编号 + */ + void deleteMaterialInventoryOut(Long id); + + /** + * 批量删除物料出库 + * + * @param ids 编号 + */ + void deleteMaterialInventoryOutListByIds(List ids); + + /** + * 获得物料出库 + * + * @param id 编号 + * @return 物料出库 + */ + MaterialInventoryOutDO getMaterialInventoryOut(Long id); + + /** + * 获得物料出库分页 + * + * @param pageReqVO 分页查询 + * @return 物料出库分页 + */ + PageResult getMaterialInventoryOutPage(MaterialInventoryOutPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventoryout/MaterialInventoryOutServiceImpl.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventoryout/MaterialInventoryOutServiceImpl.java new file mode 100644 index 0000000..6fbb38c --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventoryout/MaterialInventoryOutServiceImpl.java @@ -0,0 +1,141 @@ +package com.zteits.urbanops.module.garden.service.materialinventoryout; + +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.common.util.object.BeanUtils; +import com.zteits.urbanops.module.garden.controller.admin.materialinventoryout.vo.MaterialInventoryOutPageReqVO; +import com.zteits.urbanops.module.garden.controller.admin.materialinventoryout.vo.MaterialInventoryOutSaveReqVO; +import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialDO; +import com.zteits.urbanops.module.garden.dal.dataobject.materialinventory.MaterialInventoryDO; +import com.zteits.urbanops.module.garden.dal.dataobject.materialinventoryout.MaterialInventoryOutDO; +import com.zteits.urbanops.module.garden.dal.mysql.material.MaterialMapper; +import com.zteits.urbanops.module.garden.dal.mysql.materialinventoryout.MaterialInventoryOutMapper; +import com.zteits.urbanops.module.garden.service.materialinventory.MaterialInventoryService; +import jakarta.annotation.Resource; +import org.springframework.stereotype.Service; +import org.springframework.validation.annotation.Validated; + +import java.util.List; + +import static com.zteits.urbanops.framework.common.exception.enums.GlobalErrorCodeConstants.BAD_REQUEST; +import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception0; +import static com.zteits.urbanops.module.garden.enums.ErrorCodeConstants.MATERIAL_INVENTORY_OUT_NOT_EXISTS; + +/** + * 物料出库 Service 实现类 + * + * @author 超级管理员 + */ +@Service +@Validated +public class MaterialInventoryOutServiceImpl implements MaterialInventoryOutService { + + @Resource + private MaterialInventoryOutMapper materialInventoryOutMapper; + @Resource + private MaterialMapper materialMapper; + + @Resource + private MaterialInventoryService materialInventoryService; + @Override + public Long createMaterialInventoryOut(MaterialInventoryOutSaveReqVO createReqVO) { + // 插入 + MaterialInventoryOutDO out = BeanUtils.toBean(createReqVO, MaterialInventoryOutDO.class); + //参数校验 + MaterialDO material = materialMapper.selectOne(MaterialDO::getMaterialId,createReqVO.getMaterialId()); + if(null == material){ + throw exception0(BAD_REQUEST.getCode(), "无效参数-materialId"); + } + MaterialInventoryDO materialInventory = materialInventoryService.selectTdMaterialInventoryByMaterialId(out.getMaterialId()); + if(null == materialInventory){ + throw exception0(BAD_REQUEST.getCode(),createReqVO.getMaterialName()+"没有库存"); + } + //当前库存不足,无法出库 + if(materialInventory.getCurrentNum() < out.getOutInventoryNum()){ + throw exception0(BAD_REQUEST.getCode(),"当前库存不足,无法出库"); + } + + out.setMaterialName(material.getMaterialName()); + out.setMaterialTypeId(material.getMaterialTypeId()); + out.setMaterialTypeName(material.getMaterialTypeName()); + out.setTypeId(material.getTypeId()); + out.setTypeName(material.getTypeName()); + out.setTypeDetailId(material.getTypeDetailId()); + out.setTypeDetailName(material.getTypeDetailName()); + out.setSpecifications(material.getSpecifications()); + out.setBelongCompanyId(material.getBelongCompanyId()); + out.setBelongCompanyName(material.getBelongCompanyName()); + out.setUnitId(material.getUnitId()); + out.setUnitName(material.getUnitName()); + materialInventoryOutMapper.insert(out); + + //更新库存 + materialInventoryService.updateInVentoryByMaterialId(materialInventory, out.getOutInventoryNum()); + // 返回 + return out.getId(); + } + + @Override + public void updateMaterialInventoryOut(MaterialInventoryOutSaveReqVO updateReqVO) { + // 校验存在 + validateMaterialInventoryOutExists(updateReqVO.getId()); + // 更新 + MaterialInventoryOutDO updateObj = BeanUtils.toBean(updateReqVO, MaterialInventoryOutDO.class); + materialInventoryOutMapper.updateById(updateObj); + } + + @Override + public void deleteMaterialInventoryOut(Long id) { + // 校验存在 + MaterialInventoryOutDO materialInventoryOut = materialInventoryOutMapper.selectById(id); + if (null == materialInventoryOut) { + throw exception(MATERIAL_INVENTORY_OUT_NOT_EXISTS); + } + + //查询库存 + MaterialInventoryDO materialInventory = materialInventoryService.selectTdMaterialInventoryByMaterialId(materialInventoryOut.getMaterialId()); + if(null == materialInventory){ + throw exception0(BAD_REQUEST.getCode(),"参数错误"); + } + //库存已使用 + if(materialInventory.getCurrentNum() < materialInventoryOut.getOutInventoryNum()){ + throw exception0(BAD_REQUEST.getCode(),"库存已使用"); + } + + //入库记录减扣 + MaterialInventoryDO inventory = new MaterialInventoryDO(); + inventory.setInventoryId(materialInventory.getInventoryId()); + inventory.setMaterialId(materialInventory.getMaterialId()); + inventory.setCurrentNum(materialInventory.getCurrentNum() + materialInventoryOut.getOutInventoryNum()); + inventory.setInventoryTotalNum(materialInventory.getInventoryTotalNum() + materialInventoryOut.getOutInventoryNum()); + inventory.setOutTotalNum(materialInventory.getOutTotalNum() - materialInventoryOut.getOutInventoryNum()); + materialInventoryService.updateTdMaterialInventory(inventory); + + // 删除 + materialInventoryOutMapper.deleteById(id); + } + + @Override + public void deleteMaterialInventoryOutListByIds(List ids) { + // 删除 + materialInventoryOutMapper.deleteByIds(ids); + } + + + private void validateMaterialInventoryOutExists(Long id) { + if (materialInventoryOutMapper.selectById(id) == null) { + throw exception(MATERIAL_INVENTORY_OUT_NOT_EXISTS); + } + } + + @Override + public MaterialInventoryOutDO getMaterialInventoryOut(Long id) { + return materialInventoryOutMapper.selectById(id); + } + + @Override + public PageResult getMaterialInventoryOutPage(MaterialInventoryOutPageReqVO pageReqVO) { + return materialInventoryOutMapper.selectPage(pageReqVO); + } + +} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialtype/MaterialTypeManagerService.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialtype/MaterialTypeManagerService.java new file mode 100644 index 0000000..c32a9a7 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialtype/MaterialTypeManagerService.java @@ -0,0 +1,63 @@ +package com.zteits.urbanops.module.garden.service.materialtype; + +import java.util.*; + +import com.zteits.urbanops.module.garden.controller.admin.materialtype.vo.MaterialTypeManagerPageReqVO; +import com.zteits.urbanops.module.garden.controller.admin.materialtype.vo.MaterialTypeManagerSaveReqVO; +import jakarta.validation.*; +import com.zteits.urbanops.module.garden.dal.dataobject.materialtype.MaterialTypeManagerDO; +import com.zteits.urbanops.framework.common.pojo.PageResult; + +/** + * 耗材类别管理 Service 接口 + * + * @author 超级管理员 + */ +public interface MaterialTypeManagerService { + + /** + * 创建耗材类别管理 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createMaterialTypeManager(@Valid MaterialTypeManagerSaveReqVO createReqVO); + + /** + * 更新耗材类别管理 + * + * @param updateReqVO 更新信息 + */ + void updateMaterialTypeManager(@Valid MaterialTypeManagerSaveReqVO updateReqVO); + + /** + * 删除耗材类别管理 + * + * @param id 编号 + */ + void deleteMaterialTypeManager(Long id); + + /** + * 批量删除耗材类别管理 + * + * @param ids 编号 + */ + void deleteMaterialTypeManagerListByIds(List ids); + + /** + * 获得耗材类别管理 + * + * @param id 编号 + * @return 耗材类别管理 + */ + MaterialTypeManagerDO getMaterialTypeManager(Long id); + + /** + * 获得耗材类别管理分页 + * + * @param pageReqVO 分页查询 + * @return 耗材类别管理分页 + */ + PageResult getMaterialTypeManagerPage(MaterialTypeManagerPageReqVO pageReqVO); + +} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialtype/MaterialTypeManagerServiceImpl.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialtype/MaterialTypeManagerServiceImpl.java new file mode 100644 index 0000000..9e8c2fe --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialtype/MaterialTypeManagerServiceImpl.java @@ -0,0 +1,83 @@ +package com.zteits.urbanops.module.garden.service.materialtype; + +import com.zteits.urbanops.module.garden.controller.admin.materialtype.vo.MaterialTypeManagerPageReqVO; +import com.zteits.urbanops.module.garden.controller.admin.materialtype.vo.MaterialTypeManagerSaveReqVO; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; + +import java.util.*; + +import com.zteits.urbanops.module.garden.dal.dataobject.materialtype.MaterialTypeManagerDO; +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.common.util.object.BeanUtils; + +import com.zteits.urbanops.module.garden.dal.mysql.materialtype.MaterialTypeManagerMapper; + +import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.convertList; +import static com.zteits.urbanops.module.garden.enums.ErrorCodeConstants.*; + +/** + * 耗材类别管理 Service 实现类 + * + * @author 超级管理员 + */ +@Service +@Validated +public class MaterialTypeManagerServiceImpl implements MaterialTypeManagerService { + + @Resource + private MaterialTypeManagerMapper materialTypeManagerMapper; + + @Override + public Long createMaterialTypeManager(MaterialTypeManagerSaveReqVO createReqVO) { + // 插入 + MaterialTypeManagerDO materialTypeManager = BeanUtils.toBean(createReqVO, MaterialTypeManagerDO.class); + materialTypeManagerMapper.insert(materialTypeManager); + + // 返回 + return materialTypeManager.getId(); + } + + @Override + public void updateMaterialTypeManager(MaterialTypeManagerSaveReqVO updateReqVO) { + // 校验存在 + validateMaterialTypeManagerExists(updateReqVO.getId()); + // 更新 + MaterialTypeManagerDO updateObj = BeanUtils.toBean(updateReqVO, MaterialTypeManagerDO.class); + materialTypeManagerMapper.updateById(updateObj); + } + + @Override + public void deleteMaterialTypeManager(Long id) { + // 校验存在 + validateMaterialTypeManagerExists(id); + // 删除 + materialTypeManagerMapper.deleteById(id); + } + + @Override + public void deleteMaterialTypeManagerListByIds(List ids) { + // 删除 + materialTypeManagerMapper.deleteByIds(ids); + } + + + private void validateMaterialTypeManagerExists(Long id) { + if (materialTypeManagerMapper.selectById(id) == null) { + throw exception(MATERIAL_TYPE_MANAGER_NOT_EXISTS); + } + } + + @Override + public MaterialTypeManagerDO getMaterialTypeManager(Long id) { + return materialTypeManagerMapper.selectById(id); + } + + @Override + public PageResult getMaterialTypeManagerPage(MaterialTypeManagerPageReqVO pageReqVO) { + return materialTypeManagerMapper.selectPage(pageReqVO); + } + +} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialtype/MaterialTypeService.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialtype/MaterialTypeService.java new file mode 100644 index 0000000..cdcf3f7 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialtype/MaterialTypeService.java @@ -0,0 +1,72 @@ +package com.zteits.urbanops.module.garden.service.materialtype; + +import java.util.*; + +import com.zteits.urbanops.module.garden.controller.admin.materialtype.vo.MaterialTypePageReqVO; +import com.zteits.urbanops.module.garden.controller.admin.materialtype.vo.MaterialTypeResp; +import com.zteits.urbanops.module.garden.controller.admin.materialtype.vo.MaterialTypeSaveReqVO; +import jakarta.validation.*; +import com.zteits.urbanops.module.garden.dal.dataobject.materialtype.MaterialTypeDO; +import com.zteits.urbanops.framework.common.pojo.PageResult; + +/** + * 物料类型 Service 接口 + * + * @author 超级管理员 + */ +public interface MaterialTypeService { + + /** + * 创建物料类型 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createMaterialType(@Valid MaterialTypeSaveReqVO createReqVO); + + /** + * 更新物料类型 + * + * @param updateReqVO 更新信息 + */ + void updateMaterialType(@Valid MaterialTypeSaveReqVO updateReqVO); + + /** + * 删除物料类型 + * + * @param id 编号 + */ + void deleteMaterialType(Long id); + + /** + * 批量删除物料类型 + * + * @param ids 编号 + */ + void deleteMaterialTypeListByIds(List ids); + + /** + * 获得物料类型 + * + * @param id 编号 + * @return 物料类型 + */ + MaterialTypeDO getMaterialType(Long id); + + /** + * 获得物料类型分页 + * + * @param pageReqVO 分页查询 + * @return 物料类型分页 + */ + PageResult getMaterialTypePage(MaterialTypePageReqVO pageReqVO); + + List queryMaterialBigType(Long materialTypeId); + + List queryMaterialMidType(Long materialTypeId); + + List queryMaterialDetailType(Long parentTypeId); + + Long selectMaxTypeDetailId(Long materialTypeId, Long typeId); + +} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialtype/MaterialTypeServiceImpl.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialtype/MaterialTypeServiceImpl.java new file mode 100644 index 0000000..8fa2acd --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialtype/MaterialTypeServiceImpl.java @@ -0,0 +1,185 @@ +package com.zteits.urbanops.module.garden.service.materialtype; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.zteits.urbanops.module.garden.controller.admin.materialtype.vo.MaterialTypePageReqVO; +import com.zteits.urbanops.module.garden.controller.admin.materialtype.vo.MaterialTypeResp; +import com.zteits.urbanops.module.garden.controller.admin.materialtype.vo.MaterialTypeSaveReqVO; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; + +import java.util.*; +import java.util.stream.Collectors; + +import com.zteits.urbanops.module.garden.dal.dataobject.materialtype.MaterialTypeDO; +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.common.util.object.BeanUtils; + +import com.zteits.urbanops.module.garden.dal.mysql.materialtype.MaterialTypeMapper; + +import static com.zteits.urbanops.framework.common.exception.enums.GlobalErrorCodeConstants.BAD_REQUEST; +import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception0; +import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.convertList; +import static com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils.getLoginUserDeptId; +import static com.zteits.urbanops.module.garden.enums.ErrorCodeConstants.*; + +/** + * 物料类型 Service 实现类 + * + * @author 超级管理员 + */ +@Service +@Validated +public class MaterialTypeServiceImpl implements MaterialTypeService { + + @Resource + private MaterialTypeMapper materialTypeMapper; + + @Override + public Long createMaterialType(MaterialTypeSaveReqVO createReqVO) { + // 插入 + QueryWrapper sql = new QueryWrapper<>(); + sql.lambda().eq(MaterialTypeDO::getMaterialTypeId, createReqVO.getMaterialTypeId()) + .eq(MaterialTypeDO::getTypeId, createReqVO.getTypeId()) + .eq(MaterialTypeDO::getTypeDetailName, createReqVO.getTypeDetailName()); + List materialTypes = materialTypeMapper.selectList(sql); + if (null != materialTypes && !materialTypes.isEmpty()) { + MaterialTypeDO materialType1 = materialTypes.get(0); + throw exception0(BAD_REQUEST.getCode(), "耗材类型:"+materialType1.getMaterialTypeName()+",类别:"+materialType1.getTypeName()+",类别明细:"+materialType1.getTypeDetailName() + " 的配置已存在"); + } + Long selectMaxTypeDetailId = selectMaxTypeDetailId(createReqVO.getMaterialTypeId(), createReqVO.getTypeId()); + createReqVO.setTypeDetailId(selectMaxTypeDetailId + 1); + MaterialTypeDO materialType = BeanUtils.toBean(createReqVO, MaterialTypeDO.class); + materialType.setParentTypeId(createReqVO.getTypeId()); + materialType.setMaterialParentTypeId(createReqVO.getMaterialTypeId()); + materialType.setCreator(String.valueOf(getLoginUserDeptId())); + materialType.setUpdater(materialType.getCreator()); + materialTypeMapper.insert(materialType); + + // 返回 + return materialType.getId(); + } + + @Override + public void updateMaterialType(MaterialTypeSaveReqVO updateReqVO) { + // 校验存在 + validateMaterialTypeExists(updateReqVO.getId()); + // 更新 + MaterialTypeDO updateObj = BeanUtils.toBean(updateReqVO, MaterialTypeDO.class); + materialTypeMapper.updateById(updateObj); + } + + @Override + public void deleteMaterialType(Long id) { + // 校验存在 + validateMaterialTypeExists(id); + // 删除 + materialTypeMapper.deleteById(id); + } + + @Override + public void deleteMaterialTypeListByIds(List ids) { + // 删除 + materialTypeMapper.deleteByIds(ids); + } + + + private void validateMaterialTypeExists(Long id) { + if (materialTypeMapper.selectById(id) == null) { + throw exception(MATERIAL_TYPE_NOT_EXISTS); + } + } + + @Override + public MaterialTypeDO getMaterialType(Long id) { + return materialTypeMapper.selectById(id); + } + + @Override + public PageResult getMaterialTypePage(MaterialTypePageReqVO pageReqVO) { + return materialTypeMapper.selectPage(pageReqVO); + } + + @Override + public List queryMaterialBigType(Long materialTypeId) { + List list; + // 入参为空时查询所有,非空时按ID查询 + if (materialTypeId == null) { + list = materialTypeMapper.selectList(); + } else { + list = materialTypeMapper.selectList(MaterialTypeDO::getMaterialTypeId, materialTypeId); + } + + // 空列表判断,避免空指针 + if (list == null || list.isEmpty()) { + return List.of(); // 返回空列表而非null,更符合Java规范 + } + + Set seenIds = new HashSet<>(); + return list.stream() + .map(doObj -> { + MaterialTypeResp resp = new MaterialTypeResp(); + resp.setValue(doObj.getMaterialTypeId()); + resp.setLabel(doObj.getMaterialTypeName()); + return resp; + }) + .filter(resp -> seenIds.add(resp.getValue())) // add成功返回true(未重复) + .collect(Collectors.toList()); + } + + @Override + public List queryMaterialMidType(Long materialParentTypeId) { + List list = materialTypeMapper.selectList(MaterialTypeDO::getMaterialParentTypeId, materialParentTypeId); + // 2. 空列表判断,避免空指针 + if (list == null || list.isEmpty()) { + return List.of(); // 返回空列表而非null,更符合Java规范 + } + Set seenIds = new HashSet<>(); + return list.stream() + .map(doObj -> { + MaterialTypeResp resp = new MaterialTypeResp(); + resp.setValue(doObj.getTypeId()); + resp.setLabel(doObj.getTypeName()); + return resp; + }) + .filter(resp -> seenIds.add(resp.getValue())) // add成功返回true(未重复) + .collect(Collectors.toList()); + } + + @Override + public List queryMaterialDetailType(Long parentTypeId) { + List list = materialTypeMapper.selectList(MaterialTypeDO::getParentTypeId, parentTypeId); + // 2. 空列表判断,避免空指针 + if (list == null || list.isEmpty()) { + return List.of(); // 返回空列表而非null,更符合Java规范 + } + Set seenIds = new HashSet<>(); + return list.stream() + .map(doObj -> { + MaterialTypeResp resp = new MaterialTypeResp(); + resp.setValue(doObj.getTypeDetailId()); + resp.setLabel(doObj.getTypeDetailName()); + return resp; + }) + .filter(resp -> seenIds.add(resp.getValue())) // add成功返回true(未重复) + .collect(Collectors.toList()); + } + + @Override + public Long selectMaxTypeDetailId(Long materialTypeId, Long typeId) { + QueryWrapper qw = new QueryWrapper<>(); + qw.select("max(type_detail_id) AS maxId") + .eq("material_type_id", materialTypeId) + .eq("type_id", typeId); + + List> maps = materialTypeMapper.selectMaps(qw); + return CollectionUtils.isEmpty(maps) + ? 0L + : Optional.ofNullable((Number) maps.get(0).get("maxId")) + .map(Number::longValue) + .orElse(0L); + } + +} diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/road/RoadManagerService.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/road/RoadManagerService.java deleted file mode 100644 index 804fa77..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/road/RoadManagerService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.zteits.urbanops.module.garden.service.road; - -import com.zteits.urbanops.framework.common.pojo.PageResult; -import com.zteits.urbanops.module.garden.controller.admin.roadmanager.vo.RoadManagerPageReqVO; -import com.zteits.urbanops.module.garden.dal.dataobject.road.RoadManagerDO; - -import java.util.List; - -public interface RoadManagerService { - PageResult selectPage(RoadManagerPageReqVO reqVO); - RoadManagerDO selectById(Long id); - Boolean insert(RoadManagerDO entity); - Boolean update(RoadManagerDO entity); - Boolean deleteById(Long id); - List selectList(RoadManagerDO where); -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/road/RoadManagerServiceImpl.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/road/RoadManagerServiceImpl.java deleted file mode 100644 index 220f71f..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/road/RoadManagerServiceImpl.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.zteits.urbanops.module.garden.service.road; - -import com.zteits.urbanops.framework.common.pojo.PageResult; -import com.zteits.urbanops.module.garden.controller.admin.roadmanager.vo.RoadManagerPageReqVO; -import com.zteits.urbanops.module.garden.dal.dataobject.road.RoadManagerDO; -import com.zteits.urbanops.module.garden.dal.mysql.road.RoadManagerMapper; -import jakarta.annotation.Resource; -import org.springframework.stereotype.Service; - -import java.util.List; - -@Service -public class RoadManagerServiceImpl implements RoadManagerService { - - @Resource - private RoadManagerMapper roadManagerMapper; - - @Override - public PageResult selectPage(RoadManagerPageReqVO reqVO) { - return roadManagerMapper.selectPage(reqVO); - } - - @Override - public RoadManagerDO selectById(Long id) { - return roadManagerMapper.selectById(id); - } - - @Override - public Boolean insert(RoadManagerDO entity) { - return roadManagerMapper.insert(entity) > 0; - } - - @Override - public Boolean update(RoadManagerDO entity) { - return roadManagerMapper.updateById(entity) > 0; - } - - @Override - public Boolean deleteById(Long id) { - return roadManagerMapper.deleteById(id) > 0; - } - - @Override - public List selectList(RoadManagerDO where) { - return roadManagerMapper.selectList(new com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX() - .eqIfPresent(RoadManagerDO::getCompanyId, where.getCompanyId()) - .eqIfPresent(RoadManagerDO::getDeptId, where.getDeptId()) - .likeIfPresent(RoadManagerDO::getRoadName, where.getRoadName()) - .orderByAsc(RoadManagerDO::getRoadName)); - } -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/road/RoadService.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/road/RoadService.java new file mode 100644 index 0000000..55208d1 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/road/RoadService.java @@ -0,0 +1,62 @@ +package com.zteits.urbanops.module.garden.service.road; + +import java.util.*; +import jakarta.validation.*; +import com.zteits.urbanops.module.garden.controller.admin.road.vo.*; +import com.zteits.urbanops.module.garden.dal.dataobject.road.RoadDO; +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.common.pojo.PageParam; + +/** + * 道路管理 Service 接口 + * + * @author 超级管理员 + */ +public interface RoadService { + + /** + * 创建道路管理 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createRoad(@Valid RoadSaveReqVO createReqVO); + + /** + * 更新道路管理 + * + * @param updateReqVO 更新信息 + */ + void updateRoad(@Valid RoadSaveReqVO updateReqVO); + + /** + * 删除道路管理 + * + * @param id 编号 + */ + void deleteRoad(Long id); + + /** + * 批量删除道路管理 + * + * @param ids 编号 + */ + void deleteRoadListByIds(List ids); + + /** + * 获得道路管理 + * + * @param id 编号 + * @return 道路管理 + */ + RoadDO getRoad(Long id); + + /** + * 获得道路管理分页 + * + * @param pageReqVO 分页查询 + * @return 道路管理分页 + */ + PageResult getRoadPage(RoadPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/road/RoadServiceImpl.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/road/RoadServiceImpl.java new file mode 100644 index 0000000..25584f3 --- /dev/null +++ b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/road/RoadServiceImpl.java @@ -0,0 +1,85 @@ +package com.zteits.urbanops.module.garden.service.road; + +import cn.hutool.core.collection.CollUtil; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import com.zteits.urbanops.module.garden.controller.admin.road.vo.*; +import com.zteits.urbanops.module.garden.dal.dataobject.road.RoadDO; +import com.zteits.urbanops.framework.common.pojo.PageResult; +import com.zteits.urbanops.framework.common.pojo.PageParam; +import com.zteits.urbanops.framework.common.util.object.BeanUtils; + +import com.zteits.urbanops.module.garden.dal.mysql.road.RoadMapper; + +import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.convertList; +import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.diffList; +import static com.zteits.urbanops.module.garden.enums.ErrorCodeConstants.*; + +/** + * 道路管理 Service 实现类 + * + * @author 超级管理员 + */ +@Service +@Validated +public class RoadServiceImpl implements RoadService { + + @Resource + private RoadMapper roadMapper; + + @Override + public Long createRoad(RoadSaveReqVO createReqVO) { + // 插入 + RoadDO road = BeanUtils.toBean(createReqVO, RoadDO.class); + roadMapper.insert(road); + + // 返回 + return road.getId(); + } + + @Override + public void updateRoad(RoadSaveReqVO updateReqVO) { + // 校验存在 + validateRoadExists(updateReqVO.getId()); + // 更新 + RoadDO updateObj = BeanUtils.toBean(updateReqVO, RoadDO.class); + roadMapper.updateById(updateObj); + } + + @Override + public void deleteRoad(Long id) { + // 校验存在 + validateRoadExists(id); + // 删除 + roadMapper.deleteById(id); + } + + @Override + public void deleteRoadListByIds(List ids) { + // 删除 + roadMapper.deleteByIds(ids); + } + + + private void validateRoadExists(Long id) { + if (roadMapper.selectById(id) == null) { + // throw exception(ROAD_NOT_EXISTS); + } + } + + @Override + public RoadDO getRoad(Long id) { + return roadMapper.selectById(id); + } + + @Override + public PageResult getRoadPage(RoadPageReqVO pageReqVO) { + return roadMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/standingbook/StandingBookService.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/standingbook/StandingBookService.java deleted file mode 100644 index e14d824..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/standingbook/StandingBookService.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.zteits.urbanops.module.garden.service.standingbook; - -import com.zteits.urbanops.framework.common.pojo.PageParam; -import com.zteits.urbanops.framework.common.pojo.PageResult; -import com.zteits.urbanops.module.garden.controller.admin.standingbook.vo.StandingBookPageReqVO; -import com.zteits.urbanops.module.garden.dal.dataobject.standingbook.StandingBookDO; - -public interface StandingBookService { - PageResult selectPage(PageParam pageParam, StandingBookPageReqVO reqVO); -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/standingbook/StandingBookServiceImpl.java b/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/standingbook/StandingBookServiceImpl.java deleted file mode 100644 index 442543e..0000000 --- a/urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/standingbook/StandingBookServiceImpl.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.zteits.urbanops.module.garden.service.standingbook; - -import com.zteits.urbanops.framework.common.pojo.PageParam; -import com.zteits.urbanops.framework.common.pojo.PageResult; -import com.zteits.urbanops.module.garden.controller.admin.standingbook.vo.StandingBookPageReqVO; -import com.zteits.urbanops.module.garden.dal.dataobject.standingbook.StandingBookDO; -import com.zteits.urbanops.module.garden.dal.mysql.standingbook.StandingBookMapper; -import jakarta.annotation.Resource; -import org.springframework.stereotype.Service; - -@Service -public class StandingBookServiceImpl implements StandingBookService { - - @Resource - private StandingBookMapper mapper; - - @Override - public PageResult selectPage(PageParam pageParam, StandingBookPageReqVO reqVO) { - StandingBookDO where = new StandingBookDO(); - where.setStandingBookYear(reqVO.getStandingBookYear()); - return mapper.selectPage(pageParam, where); - } -} \ No newline at end of file diff --git a/urbanops-module-garden/src/main/resources/mapper/hotlinecase/HotlineCaseMapper.xml b/urbanops-module-garden/src/main/resources/mapper/hotlinecase/HotlineCaseMapper.xml new file mode 100644 index 0000000..b032873 --- /dev/null +++ b/urbanops-module-garden/src/main/resources/mapper/hotlinecase/HotlineCaseMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/urbanops-module-garden/src/main/resources/mapper/hotlinefile/HotlineFileMapper.xml b/urbanops-module-garden/src/main/resources/mapper/hotlinefile/HotlineFileMapper.xml new file mode 100644 index 0000000..e4e3f99 --- /dev/null +++ b/urbanops-module-garden/src/main/resources/mapper/hotlinefile/HotlineFileMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/urbanops-module-garden/src/main/resources/mapper/road/RoadMapper.xml b/urbanops-module-garden/src/main/resources/mapper/road/RoadMapper.xml new file mode 100644 index 0000000..faef970 --- /dev/null +++ b/urbanops-module-garden/src/main/resources/mapper/road/RoadMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/urbanops-module-system/src/main/java/com/zteits/urbanops/module/system/controller/admin/dept/DeptController.java b/urbanops-module-system/src/main/java/com/zteits/urbanops/module/system/controller/admin/dept/DeptController.java index 32c00c3..f559220 100644 --- a/urbanops-module-system/src/main/java/com/zteits/urbanops/module/system/controller/admin/dept/DeptController.java +++ b/urbanops-module-system/src/main/java/com/zteits/urbanops/module/system/controller/admin/dept/DeptController.java @@ -4,6 +4,7 @@ package com.zteits.urbanops.module.system.controller.admin.dept; import com.zteits.urbanops.framework.common.enums.CommonStatusEnum; import com.zteits.urbanops.framework.common.pojo.CommonResult; import com.zteits.urbanops.framework.common.util.object.BeanUtils; +import com.zteits.urbanops.module.system.api.dept.dto.DeptRespDTO; import com.zteits.urbanops.module.system.controller.admin.dept.vo.dept.DeptListReqVO; import com.zteits.urbanops.module.system.controller.admin.dept.vo.dept.DeptRespVO; import com.zteits.urbanops.module.system.controller.admin.dept.vo.dept.DeptSaveReqVO; @@ -99,4 +100,11 @@ public class DeptController { return success(BeanUtils.toBean(list, DeptRespVO.class)); } + @GetMapping("/sub-list-id") + @Operation(summary = "根据id获取子部门列表") + @PreAuthorize("@ss.hasPermission('system:dept:query')") + public CommonResult> getTeamsList(@RequestParam("id") Long id) { + List list = deptService.getSubDeptList(id); + return success(BeanUtils.toBean(list, DeptRespVO.class)); + } } diff --git a/urbanops-module-system/src/main/java/com/zteits/urbanops/module/system/service/dept/DeptService.java b/urbanops-module-system/src/main/java/com/zteits/urbanops/module/system/service/dept/DeptService.java index 6c8e72e..13449cd 100644 --- a/urbanops-module-system/src/main/java/com/zteits/urbanops/module/system/service/dept/DeptService.java +++ b/urbanops-module-system/src/main/java/com/zteits/urbanops/module/system/service/dept/DeptService.java @@ -127,4 +127,10 @@ public interface DeptService { */ void validateDeptList(Collection ids); + /** + * 根据id获取子集 + * @return 部门信息数组 + */ + List getSubDeptList(Long id); + } diff --git a/urbanops-module-system/src/main/java/com/zteits/urbanops/module/system/service/dept/DeptServiceImpl.java b/urbanops-module-system/src/main/java/com/zteits/urbanops/module/system/service/dept/DeptServiceImpl.java index 75b00cc..96b4e9f 100644 --- a/urbanops-module-system/src/main/java/com/zteits/urbanops/module/system/service/dept/DeptServiceImpl.java +++ b/urbanops-module-system/src/main/java/com/zteits/urbanops/module/system/service/dept/DeptServiceImpl.java @@ -240,4 +240,8 @@ public class DeptServiceImpl implements DeptService { }); } + @Override + public List getSubDeptList(Long id) { + return deptMapper.selectList(DeptDO::getParentId,id); + } }