diff --git a/zt-module-base/zt-module-base-api/src/main/java/com/zt/plat/module/base/enums/ErrorCodeConstants.java b/zt-module-base/zt-module-base-api/src/main/java/com/zt/plat/module/base/enums/ErrorCodeConstants.java index 447a009f..3e97983d 100644 --- a/zt-module-base/zt-module-base-api/src/main/java/com/zt/plat/module/base/enums/ErrorCodeConstants.java +++ b/zt-module-base/zt-module-base-api/src/main/java/com/zt/plat/module/base/enums/ErrorCodeConstants.java @@ -66,6 +66,8 @@ public interface ErrorCodeConstants { ErrorCode PROCESSING_OPERATION_NOT_EXISTS = new ErrorCode(1_027_101_007, "工序不存在"); ErrorCode PROCESSING_OPERATION_MATERIAL_NOT_EXISTS = new ErrorCode(1_027_101_008, "工艺工序物料不存在"); ErrorCode PLAN_DATE_NOT_EXISTS = new ErrorCode(1_027_101_009, "计划数据不存在"); + ErrorCode PLAN_ORD_NOT_EXISTS = new ErrorCode(1_027_101_010, "计划与订单关系不存在"); + ErrorCode PLAN_ORD_EXISTS = new ErrorCode(1_027_101_011, "该种类的绑定关系已存在"); // ========== 主数据同步 ========== ErrorCode MASTER_DATA_SYNC_DISABLED = new ErrorCode(1_027_900_001, "主数据同步功能已禁用"); ErrorCode MASTER_DATA_SYNC_BATCH_SIZE_TOO_LARGE = new ErrorCode(1_027_900_002, "最大批次不得超过 1000"); diff --git a/zt-module-base/zt-module-base-api/src/main/java/com/zt/plat/module/erpmonthproductiveplancheck/ErrorCodeConstants.java b/zt-module-base/zt-module-base-api/src/main/java/com/zt/plat/module/erpmonthproductiveplancheck/ErrorCodeConstants.java new file mode 100644 index 00000000..6cf55972 --- /dev/null +++ b/zt-module-base/zt-module-base-api/src/main/java/com/zt/plat/module/erpmonthproductiveplancheck/ErrorCodeConstants.java @@ -0,0 +1,14 @@ +package com.zt.plat.module.erpmonthproductiveplancheck; + +import com.zt.plat.framework.common.exception.ErrorCode; + +public interface ErrorCodeConstants { + + // ========== 示例模块 1-001-000-000 ========== + //模块 base 错误码区间[1-027-000-000 ~1-028-000-000) + + ErrorCode ERP_MONTH_PRODUCTIVE_PLAN_CHECK_NOT_EXISTS = new ErrorCode(1_027_000_709, "ERP月度产品计划核对不存在"); + ErrorCode ERP_MONTH_PRODUCTIVE_PLAN_CHECK_DETAIL_NOT_EXISTS = new ErrorCode(1_027_000_710, "ERP月度产品计划核对明细不存在"); + ErrorCode DATA_NOT_ERROR = new ErrorCode(1_027_000_711, "数据错误"); +} + diff --git a/zt-module-base/zt-module-base-server/pom.xml b/zt-module-base/zt-module-base-server/pom.xml index 3547b084..4d26359f 100644 --- a/zt-module-base/zt-module-base-server/pom.xml +++ b/zt-module-base/zt-module-base-server/pom.xml @@ -166,6 +166,12 @@ zt-spring-boot-starter-biz-business ${revision} + + com.zt.plat + zt-module-contract-order-api + 3.0.47-SNAPSHOT + compile + diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/erpmonthproductiveplancheck/ErpMonthProductivePlanCheckController.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/erpmonthproductiveplancheck/ErpMonthProductivePlanCheckController.java new file mode 100644 index 00000000..fb965008 --- /dev/null +++ b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/erpmonthproductiveplancheck/ErpMonthProductivePlanCheckController.java @@ -0,0 +1,139 @@ +package com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck; + +import com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo.ErpMonthProductivePlanCheckDetailRespVO; +import com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo.ErpMonthProductivePlanCheckPageReqVO; +import com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo.ErpMonthProductivePlanCheckRespVO; +import com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo.ErpMonthProductivePlanCheckSaveReqVO; +import com.zt.plat.module.base.dal.dataobject.erpmonthproductiveplancheck.ErpMonthProductivePlanCheckDO; +import com.zt.plat.module.base.service.erpmonthproductiveplancheck.ErpMonthProductivePlanCheckService; +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; + +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.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.util.object.BeanUtils; + +import static com.zt.plat.framework.common.pojo.CommonResult.success; + +import com.zt.plat.framework.excel.core.util.ExcelUtils; + +import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; + +import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; + + +@Tag(name = "管理后台 - ERP月度产品计划核对") +@RestController +@RequestMapping("/base/erp-month-productive-plan-check") +@Validated +public class ErpMonthProductivePlanCheckController implements BusinessControllerMarker { + + + @Resource + private ErpMonthProductivePlanCheckService erpMonthProductivePlanCheckService; + + @PostMapping("/create") + @Operation(summary = "创建ERP月度产品计划核对") + @PreAuthorize("@ss.hasPermission('base:erp-month-productive-plan-check:create')") + public CommonResult createErpMonthProductivePlanCheck(@Valid @RequestBody ErpMonthProductivePlanCheckSaveReqVO createReqVO) { + return success(erpMonthProductivePlanCheckService.createErpMonthProductivePlanCheck(createReqVO)); + } + + @PostMapping("/create-batch") + @Operation(summary = "创建ERP月度产品计划核对") + @PreAuthorize("@ss.hasPermission('base:erp-month-productive-plan-check:create')") + public CommonResult createBatchErpMonthProductivePlanCheck(@Valid @RequestBody List createReqVOList) { + erpMonthProductivePlanCheckService.createBatchErpMonthProductivePlanCheck(createReqVOList); + return success(true); + } + + @PutMapping("/update") + @Operation(summary = "更新ERP月度产品计划核对") + @PreAuthorize("@ss.hasPermission('base:erp-month-productive-plan-check:update')") + public CommonResult updateErpMonthProductivePlanCheck(@Valid @RequestBody ErpMonthProductivePlanCheckSaveReqVO updateReqVO) { + erpMonthProductivePlanCheckService.updateErpMonthProductivePlanCheck(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除ERP月度产品计划核对") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('base:erp-month-productive-plan-check:delete')") + public CommonResult deleteErpMonthProductivePlanCheck(@RequestParam("id") Long id) { + erpMonthProductivePlanCheckService.deleteErpMonthProductivePlanCheck(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除ERP月度产品计划核对") + @PreAuthorize("@ss.hasPermission('base:erp-month-productive-plan-check:delete')") + public CommonResult deleteErpMonthProductivePlanCheckList(@RequestBody BatchDeleteReqVO req) { + erpMonthProductivePlanCheckService.deleteErpMonthProductivePlanCheckListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得ERP月度产品计划核对") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('base:erp-month-productive-plan-check:query')") + public CommonResult getErpMonthProductivePlanCheck(@RequestParam("id") Long id) { + ErpMonthProductivePlanCheckDO erpMonthProductivePlanCheck = erpMonthProductivePlanCheckService.getErpMonthProductivePlanCheck(id); + ErpMonthProductivePlanCheckRespVO respVO = BeanUtils.toBean(erpMonthProductivePlanCheck, ErpMonthProductivePlanCheckRespVO.class); + if (respVO != null) { + respVO.setDetails(erpMonthProductivePlanCheckService.getErpMonthProductivePlanCheckDetail(id)); + } + return success(respVO); + } + + @GetMapping("/page") + @Operation(summary = "获得ERP月度产品计划核对分页") + @PreAuthorize("@ss.hasPermission('base:erp-month-productive-plan-check:query')") + public CommonResult> getErpMonthProductivePlanCheckPage(@Valid ErpMonthProductivePlanCheckPageReqVO pageReqVO) { + PageResult pageResult = erpMonthProductivePlanCheckService.getErpMonthProductivePlanCheckPage(pageReqVO); + PageResult result = BeanUtils.toBean(pageResult, ErpMonthProductivePlanCheckRespVO.class); + if (result != null && result.getList() != null && !result.getList().isEmpty()){ + result.getList().forEach(erpMonthProductivePlanCheckRespVO + -> erpMonthProductivePlanCheckRespVO.setDetails(erpMonthProductivePlanCheckService.getErpMonthProductivePlanCheckDetail(erpMonthProductivePlanCheckRespVO.getId()))); + } + return success(result); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出ERP月度产品计划核对 Excel") + @PreAuthorize("@ss.hasPermission('base:erp-month-productive-plan-check:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportErpMonthProductivePlanCheckExcel(@Valid ErpMonthProductivePlanCheckPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = erpMonthProductivePlanCheckService.getErpMonthProductivePlanCheckPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "ERP月度产品计划核对.xls", "数据", ErpMonthProductivePlanCheckRespVO.class, + BeanUtils.toBean(list, ErpMonthProductivePlanCheckRespVO.class)); + } + + //根据id查询明细详情 + @GetMapping("/get-detail") + @Operation(summary = "获得ERP月度产品计划核对明细详情") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('base:erp-month-productive-plan-check:query')") + public CommonResult> getErpMonthProductivePlanCheckDetail(@RequestParam("id") Long id) { + return success(erpMonthProductivePlanCheckService.getErpMonthProductivePlanCheckDetail(id)); + } +} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/erpmonthproductiveplancheck/ErpMonthProductivePlanCheckDetailController.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/erpmonthproductiveplancheck/ErpMonthProductivePlanCheckDetailController.java new file mode 100644 index 00000000..41e12122 --- /dev/null +++ b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/erpmonthproductiveplancheck/ErpMonthProductivePlanCheckDetailController.java @@ -0,0 +1,112 @@ +package com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck; + + + +import com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo.ErpMonthProductivePlanCheckDetailPageReqVO; +import com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo.ErpMonthProductivePlanCheckDetailRespVO; +import com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo.ErpMonthProductivePlanCheckDetailSaveReqVO; +import com.zt.plat.module.base.dal.dataobject.erpmonthproductiveplancheck.ErpMonthProductivePlanCheckDetailDO; +import com.zt.plat.module.base.service.erpmonthproductiveplancheck.ErpMonthProductivePlanCheckDetailService; +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; + +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.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import static com.zt.plat.framework.common.pojo.CommonResult.success; + +import com.zt.plat.framework.excel.core.util.ExcelUtils; + +import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; +import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; + + +@Tag(name = "管理后台 - ERP月度产品计划核对明细") +@RestController +@RequestMapping("/base/erp-month-productive-plan-check-detail") +@Validated +public class ErpMonthProductivePlanCheckDetailController implements BusinessControllerMarker { + + + @Resource + private ErpMonthProductivePlanCheckDetailService erpMonthProductivePlanCheckDetailService; + + @PostMapping("/create") + @Operation(summary = "创建ERP月度产品计划核对明细") + @PreAuthorize("@ss.hasPermission('base:erp-month-productive-plan-check-detail:create')") + public CommonResult createErpMonthProductivePlanCheckDetail(@Valid @RequestBody ErpMonthProductivePlanCheckDetailSaveReqVO createReqVO) { + return success(erpMonthProductivePlanCheckDetailService.createErpMonthProductivePlanCheckDetail(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新ERP月度产品计划核对明细") + @PreAuthorize("@ss.hasPermission('base:erp-month-productive-plan-check-detail:update')") + public CommonResult updateErpMonthProductivePlanCheckDetail(@Valid @RequestBody ErpMonthProductivePlanCheckDetailSaveReqVO updateReqVO) { + erpMonthProductivePlanCheckDetailService.updateErpMonthProductivePlanCheckDetail(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除ERP月度产品计划核对明细") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('base:erp-month-productive-plan-check-detail:delete')") + public CommonResult deleteErpMonthProductivePlanCheckDetail(@RequestParam("id") Long id) { + erpMonthProductivePlanCheckDetailService.deleteErpMonthProductivePlanCheckDetail(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除ERP月度产品计划核对明细") + @PreAuthorize("@ss.hasPermission('base:erp-month-productive-plan-check-detail:delete')") + public CommonResult deleteErpMonthProductivePlanCheckDetailList(@RequestBody BatchDeleteReqVO req) { + erpMonthProductivePlanCheckDetailService.deleteErpMonthProductivePlanCheckDetailListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得ERP月度产品计划核对明细") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('base:erp-month-productive-plan-check-detail:query')") + public CommonResult getErpMonthProductivePlanCheckDetail(@RequestParam("id") Long id) { + ErpMonthProductivePlanCheckDetailDO erpMonthProductivePlanCheckDetail = erpMonthProductivePlanCheckDetailService.getErpMonthProductivePlanCheckDetail(id); + return success(BeanUtils.toBean(erpMonthProductivePlanCheckDetail, ErpMonthProductivePlanCheckDetailRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得ERP月度产品计划核对明细分页") + @PreAuthorize("@ss.hasPermission('base:erp-month-productive-plan-check-detail:query')") + public CommonResult> getErpMonthProductivePlanCheckDetailPage(@Valid ErpMonthProductivePlanCheckDetailPageReqVO pageReqVO) { + PageResult pageResult = erpMonthProductivePlanCheckDetailService.getErpMonthProductivePlanCheckDetailPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, ErpMonthProductivePlanCheckDetailRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出ERP月度产品计划核对明细 Excel") + @PreAuthorize("@ss.hasPermission('base:erp-month-productive-plan-check-detail:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportErpMonthProductivePlanCheckDetailExcel(@Valid ErpMonthProductivePlanCheckDetailPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = erpMonthProductivePlanCheckDetailService.getErpMonthProductivePlanCheckDetailPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "ERP月度产品计划核对明细.xls", "数据", ErpMonthProductivePlanCheckDetailRespVO.class, + BeanUtils.toBean(list, ErpMonthProductivePlanCheckDetailRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/erpmonthproductiveplancheck/vo/ErpMonthProductivePlanCheckDetailPageReqVO.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/erpmonthproductiveplancheck/vo/ErpMonthProductivePlanCheckDetailPageReqVO.java new file mode 100644 index 00000000..de786154 --- /dev/null +++ b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/erpmonthproductiveplancheck/vo/ErpMonthProductivePlanCheckDetailPageReqVO.java @@ -0,0 +1,34 @@ +package com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zt.plat.framework.common.pojo.PageParam; +import java.math.BigDecimal; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - ERP月度产品计划核对明细分页 Request VO") +@Data +public class ErpMonthProductivePlanCheckDetailPageReqVO extends PageParam { + + @Schema(description = "日期(格式:YYYY-MM-DD)") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private String[] date; + + @Schema(description = "排序") + private Integer sort; + + @Schema(description = "值") + private BigDecimal value; + + @Schema(description = "主数据ID(关联主表ID)", example = "3745") + private Long mainId; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/erpmonthproductiveplancheck/vo/ErpMonthProductivePlanCheckDetailRespVO.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/erpmonthproductiveplancheck/vo/ErpMonthProductivePlanCheckDetailRespVO.java new file mode 100644 index 00000000..da501488 --- /dev/null +++ b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/erpmonthproductiveplancheck/vo/ErpMonthProductivePlanCheckDetailRespVO.java @@ -0,0 +1,40 @@ +package com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.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 com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - ERP月度产品计划核对明细 Response VO") +@Data +@ExcelIgnoreUnannotated +public class ErpMonthProductivePlanCheckDetailRespVO { + + @Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14111") + @ExcelProperty("主键ID") + private Long id; + + @Schema(description = "日期(格式:YYYY-MM-DD)") + @ExcelProperty("日期(格式:YYYY-MM-DD)") + private String date; + + @Schema(description = "排序") + @ExcelProperty("排序") + private Integer sort; + + @Schema(description = "值") + @ExcelProperty("值") + private BigDecimal value; + + @Schema(description = "主数据ID(关联主表ID)", example = "3745") + @ExcelProperty("主数据ID(关联主表ID)") + private Long mainId; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/erpmonthproductiveplancheck/vo/ErpMonthProductivePlanCheckDetailSaveReqVO.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/erpmonthproductiveplancheck/vo/ErpMonthProductivePlanCheckDetailSaveReqVO.java new file mode 100644 index 00000000..48e790dd --- /dev/null +++ b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/erpmonthproductiveplancheck/vo/ErpMonthProductivePlanCheckDetailSaveReqVO.java @@ -0,0 +1,28 @@ +package com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; +import java.math.BigDecimal; + +@Schema(description = "管理后台 - ERP月度产品计划核对明细新增/修改 Request VO") +@Data +public class ErpMonthProductivePlanCheckDetailSaveReqVO { + + @Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14111") + private Long id; + + @Schema(description = "日期(格式:YYYY-MM-DD)") + private String date; + + @Schema(description = "排序") + private Integer sort; + + @Schema(description = "值") + private BigDecimal value; + + @Schema(description = "主数据ID(关联主表ID)", example = "3745") + private Long mainId; + +} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/erpmonthproductiveplancheck/vo/ErpMonthProductivePlanCheckPageReqVO.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/erpmonthproductiveplancheck/vo/ErpMonthProductivePlanCheckPageReqVO.java new file mode 100644 index 00000000..a4dc12c2 --- /dev/null +++ b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/erpmonthproductiveplancheck/vo/ErpMonthProductivePlanCheckPageReqVO.java @@ -0,0 +1,33 @@ +package com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zt.plat.framework.common.pojo.PageParam; +import java.math.BigDecimal; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - ERP月度产品计划核对分页 Request VO") +@Data +public class ErpMonthProductivePlanCheckPageReqVO extends PageParam { + + @Schema(description = "产品名") + private String product; + + @Schema(description = "年度") + private String year; + + @Schema(description = "月份") + private String month; + + @Schema(description = "月计划量") + private BigDecimal monthPlan; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/erpmonthproductiveplancheck/vo/ErpMonthProductivePlanCheckRespVO.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/erpmonthproductiveplancheck/vo/ErpMonthProductivePlanCheckRespVO.java new file mode 100644 index 00000000..0b9d1bdf --- /dev/null +++ b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/erpmonthproductiveplancheck/vo/ErpMonthProductivePlanCheckRespVO.java @@ -0,0 +1,43 @@ +package com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.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 com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - ERP月度产品计划核对 Response VO") +@Data +@ExcelIgnoreUnannotated +public class ErpMonthProductivePlanCheckRespVO { + + @Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19081") + @ExcelProperty("主键ID") + private Long id; + + @Schema(description = "产品名") + @ExcelProperty("产品名") + private String product; + + @Schema(description = "年度") + @ExcelProperty("年度") + private String year; + + @Schema(description = "月份") + @ExcelProperty("月份") + private String month; + + @Schema(description = "月计划量") + @ExcelProperty("月计划量") + private BigDecimal monthPlan; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + @Schema(description = "详情") + @ExcelProperty("详情") + private List details; + +} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/erpmonthproductiveplancheck/vo/ErpMonthProductivePlanCheckSaveReqVO.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/erpmonthproductiveplancheck/vo/ErpMonthProductivePlanCheckSaveReqVO.java new file mode 100644 index 00000000..20e8ef21 --- /dev/null +++ b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/erpmonthproductiveplancheck/vo/ErpMonthProductivePlanCheckSaveReqVO.java @@ -0,0 +1,31 @@ +package com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; +import java.math.BigDecimal; + +@Schema(description = "管理后台 - ERP月度产品计划核对新增/修改 Request VO") +@Data +public class ErpMonthProductivePlanCheckSaveReqVO { + + @Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19081") + private Long id; + + @Schema(description = "产品名") + private String product; + + @Schema(description = "年度") + private String year; + + @Schema(description = "月份") + private String month; + + @Schema(description = "月计划量") + private BigDecimal monthPlan; + + @Schema(description = "月计划明细") + private List details; + +} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/plandate/PlanDateController.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/plandate/PlanDateController.java index 48eeab86..3cfe3265 100644 --- a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/plandate/PlanDateController.java +++ b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/plandate/PlanDateController.java @@ -113,7 +113,7 @@ public class PlanDateController implements BusinessControllerMarker { @GetMapping("/tree/list-all") @Operation(summary = "查询所有计划数据(树形结构)") @PreAuthorize("@ss.hasPermission('base:plan-date:query')") - public List listAllPlanDateTree() { - return planDateService.listPlanDateTree(); + public CommonResult> listAllPlanDateTree() { + return success(planDateService.listPlanDateTree()); } } \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/plandate/PlanOrderController.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/plandate/PlanOrderController.java new file mode 100644 index 00000000..3559c5f5 --- /dev/null +++ b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/plandate/PlanOrderController.java @@ -0,0 +1,59 @@ +package com.zt.plat.module.base.controller.admin.plandate; + +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.module.base.controller.admin.plandate.vo.PlanDateRespVO; +import com.zt.plat.module.base.controller.admin.plandate.vo.PlanOrderSaveReqVO; +import com.zt.plat.module.base.service.plandate.PlanOrderService; +import com.zt.plat.module.contractorder.api.dto.order.OrderAndPlanDataReqDTO; +import com.zt.plat.module.contractorder.api.dto.order.OrderDTO; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.annotation.Resource; +import org.apache.ibatis.annotations.Delete; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import static com.zt.plat.framework.common.pojo.CommonResult.success; + + +@Tag(name = "管理后台 - 计划数据与订单绑定") +@RestController +@RequestMapping("/base/plan-order") +@Validated +public class PlanOrderController { + @Resource + private PlanOrderService planOrderService; + //绑定订单 + @PostMapping("/bind-order") + @Operation(summary = "计划与订单绑定") + @PreAuthorize("@ss.hasAnyPermissions({'base:plan-date:tree:list-all:query'})") + public CommonResult bindOrder(@RequestBody PlanOrderSaveReqVO reqVO) { + return success( planOrderService.bindOrder(reqVO)); + } + //解绑订单 + @DeleteMapping("/release-order") + @Operation(summary = "计划与订单解绑") + @PreAuthorize("@ss.hasAnyPermissions({'base:plan-date:tree:list-all:releaseOrder'})") + public CommonResult unbindOrder(@RequestParam("planId") String planId,@RequestParam("orderNumber") String orderNumber) { + planOrderService.unbindOrder(planId, orderNumber); + return success(true); + } + //根据订单号获取已绑定的订单 + @GetMapping("/get-bound-order") + @Operation(summary = "根据计划ID获取已绑定的订单") + @PreAuthorize("@ss.hasAnyPermissions({'base:plan-date:tree:list-all:query'})") + public CommonResult getBoundOrder(@RequestParam("planId") String planId) { + return success(planOrderService.getBoundOrder(planId)); + } + + //根据计划和订单的参数查询相关的订单 + @PostMapping("/query-order-plan-data") + @Operation(summary = "根据计划和订单的参数查询相关的订单") + @PreAuthorize("@ss.hasAnyPermissions({'base:plan-date:tree:list-all:query'})") + public CommonResult> queryOrder(@RequestBody OrderAndPlanDataReqDTO reqVO) { + return success(planOrderService.queryOrderAndPlanData(reqVO)); + } + +} diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/plandate/vo/PlanOrderRspVO.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/plandate/vo/PlanOrderRspVO.java new file mode 100644 index 00000000..6e8e2969 --- /dev/null +++ b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/plandate/vo/PlanOrderRspVO.java @@ -0,0 +1,34 @@ +package com.zt.plat.module.base.controller.admin.plandate.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +@Schema(description = "计划数据与订单绑定响应VO") +public class PlanOrderRspVO { + /** + * 编号 + */ + @Schema(description = "编号") + private Long id; + /** + * 订单编号 + */ + @Schema(description = "订单号") + private String orderNumber; + /** + * 订单类型 + */ + @Schema(description = "订单类型") + private String orderType; + /** + * 计划ID + */ + @Schema(description = "计划ID") + private Long planId; + /** + * 订单状态 + */ + @Schema(description = "订单状态") + private String orderStatus; +} diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/plandate/vo/PlanOrderSaveReqVO.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/plandate/vo/PlanOrderSaveReqVO.java new file mode 100644 index 00000000..3e7f6545 --- /dev/null +++ b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/plandate/vo/PlanOrderSaveReqVO.java @@ -0,0 +1,35 @@ +package com.zt.plat.module.base.controller.admin.plandate.vo; + +import com.baomidou.mybatisplus.annotation.TableField; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +@Schema(description = "保存计划数据与订单绑定的请求VO") +public class PlanOrderSaveReqVO { + /** + * 编号 + */ + @Schema(description = "编号") + private Long id; + /** + * 订单编号 + */ + @Schema(description = "订单号") + private String orderNumber; + /** + * 订单类型 + */ + @Schema(description = "订单类型") + private String orderType; + /** + * 订单ID + */ + @Schema(description = "订单ID") + private Long orderId; + /** + * 计划ID + */ + @Schema(description = "计划ID") + private Long planId; +} diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/dal/dao/erpmonthproductiveplancheck/ErpMonthProductivePlanCheckDetailMapper.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/dal/dao/erpmonthproductiveplancheck/ErpMonthProductivePlanCheckDetailMapper.java new file mode 100644 index 00000000..6ebdcb4d --- /dev/null +++ b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/dal/dao/erpmonthproductiveplancheck/ErpMonthProductivePlanCheckDetailMapper.java @@ -0,0 +1,31 @@ +package com.zt.plat.module.base.dal.dao.erpmonthproductiveplancheck; + +import java.util.*; + +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo.ErpMonthProductivePlanCheckDetailPageReqVO; +import com.zt.plat.module.base.dal.dataobject.erpmonthproductiveplancheck.ErpMonthProductivePlanCheckDetailDO; +import org.apache.ibatis.annotations.Mapper; + + +/** + * ERP月度产品计划核对明细 Mapper + * + * @author 后台管理-1 + */ +@Mapper +public interface ErpMonthProductivePlanCheckDetailMapper extends BaseMapperX { + + default PageResult selectPage(ErpMonthProductivePlanCheckDetailPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .betweenIfPresent(ErpMonthProductivePlanCheckDetailDO::getDate, reqVO.getDate()) + .eqIfPresent(ErpMonthProductivePlanCheckDetailDO::getSort, reqVO.getSort()) + .eqIfPresent(ErpMonthProductivePlanCheckDetailDO::getValue, reqVO.getValue()) + .eqIfPresent(ErpMonthProductivePlanCheckDetailDO::getMainId, reqVO.getMainId()) + .betweenIfPresent(ErpMonthProductivePlanCheckDetailDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(ErpMonthProductivePlanCheckDetailDO::getId)); + } + +} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/dal/dao/erpmonthproductiveplancheck/ErpMonthProductivePlanCheckMapper.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/dal/dao/erpmonthproductiveplancheck/ErpMonthProductivePlanCheckMapper.java new file mode 100644 index 00000000..3b719f93 --- /dev/null +++ b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/dal/dao/erpmonthproductiveplancheck/ErpMonthProductivePlanCheckMapper.java @@ -0,0 +1,32 @@ +package com.zt.plat.module.base.dal.dao.erpmonthproductiveplancheck; + +import java.util.*; + +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; + +import com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo.ErpMonthProductivePlanCheckPageReqVO; +import com.zt.plat.module.base.dal.dataobject.erpmonthproductiveplancheck.ErpMonthProductivePlanCheckDO; +import org.apache.ibatis.annotations.Mapper; + + +/** + * ERP月度产品计划核对 Mapper + * + * @author 后台管理-1 + */ +@Mapper +public interface ErpMonthProductivePlanCheckMapper extends BaseMapperX { + + default PageResult selectPage(ErpMonthProductivePlanCheckPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(ErpMonthProductivePlanCheckDO::getProduct, reqVO.getProduct()) + .eqIfPresent(ErpMonthProductivePlanCheckDO::getYear, reqVO.getYear()) + .eqIfPresent(ErpMonthProductivePlanCheckDO::getMonth, reqVO.getMonth()) + .eqIfPresent(ErpMonthProductivePlanCheckDO::getMonthPlan, reqVO.getMonthPlan()) + .betweenIfPresent(ErpMonthProductivePlanCheckDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(ErpMonthProductivePlanCheckDO::getId)); + } + +} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/dal/dao/plandate/PlanOrderMapper.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/dal/dao/plandate/PlanOrderMapper.java new file mode 100644 index 00000000..115a4b5e --- /dev/null +++ b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/dal/dao/plandate/PlanOrderMapper.java @@ -0,0 +1,9 @@ +package com.zt.plat.module.base.dal.dao.plandate; + +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import com.zt.plat.module.base.dal.dataobject.plandate.PlanOrderDO; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface PlanOrderMapper extends BaseMapperX { +} diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/dal/dataobject/erpmonthproductiveplancheck/ErpMonthProductivePlanCheckDO.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/dal/dataobject/erpmonthproductiveplancheck/ErpMonthProductivePlanCheckDO.java new file mode 100644 index 00000000..e6b312fe --- /dev/null +++ b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/dal/dataobject/erpmonthproductiveplancheck/ErpMonthProductivePlanCheckDO.java @@ -0,0 +1,56 @@ +package com.zt.plat.module.base.dal.dataobject.erpmonthproductiveplancheck; + +import lombok.*; +import java.util.*; + import java.math.BigDecimal; + import java.time.LocalDateTime; + import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* ERP月度产品计划核对 DO +* +* @author 后台管理-1 +*/ +@TableName("bes_erp_mnt_pdtv_pln_chk") +@KeySequence("bes_erp_mnt_pdtv_pln_chk_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class ErpMonthProductivePlanCheckDO extends BusinessBaseDO { + + + + /** + * 主键ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 产品名 + */ + @TableField("PDT") + private String product; + /** + * 年度 + */ + @TableField("YR") + private String year; + /** + * 月份 + */ + @TableField("MNT") + private String month; + /** + * 月计划量 + */ + @TableField("MNT_PLN") + private BigDecimal monthPlan; + +} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/dal/dataobject/erpmonthproductiveplancheck/ErpMonthProductivePlanCheckDetailDO.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/dal/dataobject/erpmonthproductiveplancheck/ErpMonthProductivePlanCheckDetailDO.java new file mode 100644 index 00000000..25d04f4e --- /dev/null +++ b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/dal/dataobject/erpmonthproductiveplancheck/ErpMonthProductivePlanCheckDetailDO.java @@ -0,0 +1,56 @@ +package com.zt.plat.module.base.dal.dataobject.erpmonthproductiveplancheck; + +import lombok.*; +import java.util.*; + import java.math.BigDecimal; + import java.time.LocalDateTime; + import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* ERP月度产品计划核对明细 DO +* +* @author 后台管理-1 +*/ +@TableName("bes_erp_mnt_pdtv_pln_chk_dtl") +@KeySequence("bes_erp_mnt_pdtv_pln_chk_dtl_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class ErpMonthProductivePlanCheckDetailDO extends BusinessBaseDO { + + + + /** + * 主键ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 日期(格式:YYYY-MM-DD) + */ + @TableField("DT") + private String date; + /** + * 排序 + */ + @TableField("SRT") + private Integer sort; + /** + * 值 + */ + @TableField("VAL") + private BigDecimal value; + /** + * 主数据ID(关联主表ID) + */ + @TableField("MAIN_ID") + private Long mainId; + +} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/dal/dataobject/plandate/PlanOrderDO.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/dal/dataobject/plandate/PlanOrderDO.java new file mode 100644 index 00000000..5df5da91 --- /dev/null +++ b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/dal/dataobject/plandate/PlanOrderDO.java @@ -0,0 +1,51 @@ +package com.zt.plat.module.base.dal.dataobject.plandate; + +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +import lombok.*; + +/** + * 计划订单 DO + * + * @author 后台管理-1 + */ +@TableName("bse_pln_ord_corr") +@KeySequence("bse_pln_ord_corr_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** + * 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO + */ +public class PlanOrderDO extends BusinessBaseDO { + /** + * 编号 + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 订单编号 + */ + @TableField("ORD_NUM") + private String orderNumber; + + /** + * 订单类型 + */ + @TableField("ORD_ID") + private Long orderId; + + /** + * 订单类型 + */ + @TableField("ORD_TP") + private String orderType; + /** + * 计划ID + */ + @TableField("PLN_ID") + private Long planId; +} diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/service/erpmonthproductiveplancheck/ErpMonthProductivePlanCheckDetailService.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/service/erpmonthproductiveplancheck/ErpMonthProductivePlanCheckDetailService.java new file mode 100644 index 00000000..7160ae18 --- /dev/null +++ b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/service/erpmonthproductiveplancheck/ErpMonthProductivePlanCheckDetailService.java @@ -0,0 +1,81 @@ +package com.zt.plat.module.base.service.erpmonthproductiveplancheck; + +import java.util.*; + +import com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo.ErpMonthProductivePlanCheckDetailPageReqVO; +import com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo.ErpMonthProductivePlanCheckDetailRespVO; +import com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo.ErpMonthProductivePlanCheckDetailSaveReqVO; +import com.zt.plat.module.base.dal.dataobject.erpmonthproductiveplancheck.ErpMonthProductivePlanCheckDetailDO; +import jakarta.validation.*; + +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.PageParam; + +/** + * ERP月度产品计划核对明细 Service 接口 + * + * @author 后台管理-1 + */ +public interface ErpMonthProductivePlanCheckDetailService { + + /** + * 创建ERP月度产品计划核对明细 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + ErpMonthProductivePlanCheckDetailRespVO createErpMonthProductivePlanCheckDetail(@Valid ErpMonthProductivePlanCheckDetailSaveReqVO createReqVO); + + /** + * 创建ERP月度产品计划核对明细 + * + * @param createReqVOS 创建信息 + * @return 编号 + */ + List createErpMonthProductivePlanCheckDetail(@Valid List createReqVOS); + + /** + * 更新ERP月度产品计划核对明细 + * + * @param updateReqVO 更新信息 + */ + void updateErpMonthProductivePlanCheckDetail(@Valid ErpMonthProductivePlanCheckDetailSaveReqVO updateReqVO); + + /** + * 删除ERP月度产品计划核对明细 + * + * @param id 编号 + */ + void deleteErpMonthProductivePlanCheckDetail(Long id); + + /** + * 批量删除ERP月度产品计划核对明细 + * + * @param ids 编号 + */ + void deleteErpMonthProductivePlanCheckDetailListByIds(List ids); + + /** + * 获得ERP月度产品计划核对明细 + * + * @param id 编号 + * @return ERP月度产品计划核对明细 + */ + ErpMonthProductivePlanCheckDetailDO getErpMonthProductivePlanCheckDetail(Long id); + + /** + * 获得ERP月度产品计划核对明细分页 + * + * @param pageReqVO 分页查询 + * @return ERP月度产品计划核对明细分页 + */ + PageResult getErpMonthProductivePlanCheckDetailPage(ErpMonthProductivePlanCheckDetailPageReqVO pageReqVO); + + /** + * 根据mainId获取到ERP月度产品计划核对明细 + * + * @param mainId 分页查询 + * @return ERP月度产品计划核对明细 + */ + List getErpMonthProductivePlanCheckDetailListByMainId(Long mainId); +} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/service/erpmonthproductiveplancheck/ErpMonthProductivePlanCheckDetailServiceImpl.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/service/erpmonthproductiveplancheck/ErpMonthProductivePlanCheckDetailServiceImpl.java new file mode 100644 index 00000000..d1efa357 --- /dev/null +++ b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/service/erpmonthproductiveplancheck/ErpMonthProductivePlanCheckDetailServiceImpl.java @@ -0,0 +1,106 @@ +package com.zt.plat.module.base.service.erpmonthproductiveplancheck; + +import cn.hutool.core.collection.CollUtil; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo.ErpMonthProductivePlanCheckDetailPageReqVO; +import com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo.ErpMonthProductivePlanCheckDetailRespVO; +import com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo.ErpMonthProductivePlanCheckDetailSaveReqVO; +import com.zt.plat.module.base.dal.dao.erpmonthproductiveplancheck.ErpMonthProductivePlanCheckDetailMapper; +import com.zt.plat.module.base.dal.dataobject.erpmonthproductiveplancheck.ErpMonthProductivePlanCheckDetailDO; +import jakarta.annotation.Resource; +import org.springframework.stereotype.Service; +import org.springframework.validation.annotation.Validated; + +import java.util.List; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.module.erpmonthproductiveplancheck.ErrorCodeConstants.ERP_MONTH_PRODUCTIVE_PLAN_CHECK_DETAIL_NOT_EXISTS; + + +/** + * ERP月度产品计划核对明细 Service 实现类 + * + * @author 后台管理-1 + */ +@Service +@Validated +public class ErpMonthProductivePlanCheckDetailServiceImpl implements ErpMonthProductivePlanCheckDetailService { + + @Resource + private ErpMonthProductivePlanCheckDetailMapper erpMonthProductivePlanCheckDetailMapper; + + @Override + public ErpMonthProductivePlanCheckDetailRespVO createErpMonthProductivePlanCheckDetail(ErpMonthProductivePlanCheckDetailSaveReqVO createReqVO) { + // 插入 + ErpMonthProductivePlanCheckDetailDO erpMonthProductivePlanCheckDetail = BeanUtils.toBean(createReqVO, ErpMonthProductivePlanCheckDetailDO.class); + erpMonthProductivePlanCheckDetailMapper.insert(erpMonthProductivePlanCheckDetail); + // 返回 + return BeanUtils.toBean(erpMonthProductivePlanCheckDetail, ErpMonthProductivePlanCheckDetailRespVO.class); + } + + @Override + public List createErpMonthProductivePlanCheckDetail(List createReqVOS) { + if (CollUtil.isEmpty(createReqVOS)) { + return List.of(); + } + List erpMonthProductivePlanCheckDetails = BeanUtils.toBean(createReqVOS, ErpMonthProductivePlanCheckDetailDO.class); + erpMonthProductivePlanCheckDetailMapper.insertBatch(erpMonthProductivePlanCheckDetails); + return BeanUtils.toBean(erpMonthProductivePlanCheckDetails, ErpMonthProductivePlanCheckDetailRespVO.class); + } + + @Override + public void updateErpMonthProductivePlanCheckDetail(ErpMonthProductivePlanCheckDetailSaveReqVO updateReqVO) { + // 校验存在 + validateErpMonthProductivePlanCheckDetailExists(updateReqVO.getId()); + // 更新 + ErpMonthProductivePlanCheckDetailDO updateObj = BeanUtils.toBean(updateReqVO, ErpMonthProductivePlanCheckDetailDO.class); + erpMonthProductivePlanCheckDetailMapper.updateById(updateObj); + } + + @Override + public void deleteErpMonthProductivePlanCheckDetail(Long id) { + // 校验存在 + validateErpMonthProductivePlanCheckDetailExists(id); + // 删除 + erpMonthProductivePlanCheckDetailMapper.deleteById(id); + } + + @Override + public void deleteErpMonthProductivePlanCheckDetailListByIds(List ids) { + // 校验存在 + validateErpMonthProductivePlanCheckDetailExists(ids); + // 删除 + erpMonthProductivePlanCheckDetailMapper.deleteByIds(ids); + } + + private void validateErpMonthProductivePlanCheckDetailExists(List ids) { + List list = erpMonthProductivePlanCheckDetailMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(ERP_MONTH_PRODUCTIVE_PLAN_CHECK_DETAIL_NOT_EXISTS); + } + } + + private void validateErpMonthProductivePlanCheckDetailExists(Long id) { + if (erpMonthProductivePlanCheckDetailMapper.selectById(id) == null) { + throw exception(ERP_MONTH_PRODUCTIVE_PLAN_CHECK_DETAIL_NOT_EXISTS); + } + } + + @Override + public ErpMonthProductivePlanCheckDetailDO getErpMonthProductivePlanCheckDetail(Long id) { + return erpMonthProductivePlanCheckDetailMapper.selectById(id); + } + + @Override + public PageResult getErpMonthProductivePlanCheckDetailPage(ErpMonthProductivePlanCheckDetailPageReqVO pageReqVO) { + return erpMonthProductivePlanCheckDetailMapper.selectPage(pageReqVO); + } + + @Override + public List getErpMonthProductivePlanCheckDetailListByMainId(Long mainId) { + + return BeanUtils.toBean(erpMonthProductivePlanCheckDetailMapper.selectList(ErpMonthProductivePlanCheckDetailDO::getMainId, mainId), ErpMonthProductivePlanCheckDetailRespVO.class); + } + +} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/service/erpmonthproductiveplancheck/ErpMonthProductivePlanCheckService.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/service/erpmonthproductiveplancheck/ErpMonthProductivePlanCheckService.java new file mode 100644 index 00000000..c2725e76 --- /dev/null +++ b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/service/erpmonthproductiveplancheck/ErpMonthProductivePlanCheckService.java @@ -0,0 +1,78 @@ +package com.zt.plat.module.base.service.erpmonthproductiveplancheck; + +import java.util.*; + +import com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo.ErpMonthProductivePlanCheckDetailRespVO; +import com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo.ErpMonthProductivePlanCheckPageReqVO; +import com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo.ErpMonthProductivePlanCheckRespVO; +import com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo.ErpMonthProductivePlanCheckSaveReqVO; +import com.zt.plat.module.base.dal.dataobject.erpmonthproductiveplancheck.ErpMonthProductivePlanCheckDO; +import jakarta.validation.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.PageParam; + +/** + * ERP月度产品计划核对 Service 接口 + * + * @author 后台管理-1 + */ +public interface ErpMonthProductivePlanCheckService { + + /** + * 创建ERP月度产品计划核对 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + ErpMonthProductivePlanCheckRespVO createErpMonthProductivePlanCheck(@Valid ErpMonthProductivePlanCheckSaveReqVO createReqVO); + + /** + * 更新ERP月度产品计划核对 + * + * @param updateReqVO 更新信息 + */ + void updateErpMonthProductivePlanCheck(@Valid ErpMonthProductivePlanCheckSaveReqVO updateReqVO); + + /** + * 删除ERP月度产品计划核对 + * + * @param id 编号 + */ + void deleteErpMonthProductivePlanCheck(Long id); + + /** + * 批量删除ERP月度产品计划核对 + * + * @param ids 编号 + */ + void deleteErpMonthProductivePlanCheckListByIds(List ids); + + /** + * 获得ERP月度产品计划核对 + * + * @param id 编号 + * @return ERP月度产品计划核对 + */ + ErpMonthProductivePlanCheckDO getErpMonthProductivePlanCheck(Long id); + + /** + * 获得ERP月度产品计划核对分页 + * + * @param pageReqVO 分页查询 + * @return ERP月度产品计划核对分页 + */ + PageResult getErpMonthProductivePlanCheckPage(ErpMonthProductivePlanCheckPageReqVO pageReqVO); + /** + * 批量创建ERP月度产品计划核对 + * + * @param createReqVOList 创建信息 + */ + void createBatchErpMonthProductivePlanCheck(List createReqVOList); + /** + * 获得ERP月度产品计划核对明细 + * + * @param id 编号 + * @return ERP月度产品计划核对明细 + */ + List getErpMonthProductivePlanCheckDetail(Long id); +} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/service/erpmonthproductiveplancheck/ErpMonthProductivePlanCheckServiceImpl.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/service/erpmonthproductiveplancheck/ErpMonthProductivePlanCheckServiceImpl.java new file mode 100644 index 00000000..7c82fffe --- /dev/null +++ b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/service/erpmonthproductiveplancheck/ErpMonthProductivePlanCheckServiceImpl.java @@ -0,0 +1,133 @@ +package com.zt.plat.module.base.service.erpmonthproductiveplancheck; + +import cn.hutool.core.collection.CollUtil; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo.ErpMonthProductivePlanCheckDetailRespVO; +import com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo.ErpMonthProductivePlanCheckPageReqVO; +import com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo.ErpMonthProductivePlanCheckRespVO; +import com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo.ErpMonthProductivePlanCheckSaveReqVO; +import com.zt.plat.module.base.dal.dao.erpmonthproductiveplancheck.ErpMonthProductivePlanCheckMapper; +import com.zt.plat.module.base.dal.dataobject.erpmonthproductiveplancheck.ErpMonthProductivePlanCheckDO; +import jakarta.annotation.Resource; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.validation.annotation.Validated; + +import java.util.ArrayList; +import java.util.List; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.module.erpmonthproductiveplancheck.ErrorCodeConstants.DATA_NOT_ERROR; +import static com.zt.plat.module.erpmonthproductiveplancheck.ErrorCodeConstants.ERP_MONTH_PRODUCTIVE_PLAN_CHECK_NOT_EXISTS; + + +/** + * ERP月度产品计划核对 Service 实现类 + * + * @author 后台管理-1 + */ +@Service +@Validated +public class ErpMonthProductivePlanCheckServiceImpl implements ErpMonthProductivePlanCheckService { + + @Resource + private ErpMonthProductivePlanCheckMapper erpMonthProductivePlanCheckMapper; + + + @Resource + private ErpMonthProductivePlanCheckDetailService erpMonthProductivePlanCheckDetailService; + + @Override + public ErpMonthProductivePlanCheckRespVO createErpMonthProductivePlanCheck(ErpMonthProductivePlanCheckSaveReqVO createReqVO) { + // 插入 + ErpMonthProductivePlanCheckDO erpMonthProductivePlanCheck = BeanUtils.toBean(createReqVO, ErpMonthProductivePlanCheckDO.class); + erpMonthProductivePlanCheckMapper.insert(erpMonthProductivePlanCheck); + List erpMonthProductivePlanCheckDetail = new ArrayList<>(); + if (createReqVO.getDetails() != null && !createReqVO.getDetails().isEmpty()) { + createReqVO.getDetails().forEach(detail -> detail.setMainId(erpMonthProductivePlanCheck.getId())); + erpMonthProductivePlanCheckDetail = erpMonthProductivePlanCheckDetailService.createErpMonthProductivePlanCheckDetail(createReqVO.getDetails()); + } + // 返回 + ErpMonthProductivePlanCheckRespVO erpMonthProductivePlanCheckRespVO = BeanUtils.toBean(erpMonthProductivePlanCheck, ErpMonthProductivePlanCheckRespVO.class); + erpMonthProductivePlanCheckRespVO.setDetails(erpMonthProductivePlanCheckDetail); + return erpMonthProductivePlanCheckRespVO; + } + + @Override + public void updateErpMonthProductivePlanCheck(ErpMonthProductivePlanCheckSaveReqVO updateReqVO) { + // 校验存在 + validateErpMonthProductivePlanCheckExists(updateReqVO.getId()); + // 更新 + ErpMonthProductivePlanCheckDO updateObj = BeanUtils.toBean(updateReqVO, ErpMonthProductivePlanCheckDO.class); + erpMonthProductivePlanCheckMapper.updateById(updateObj); + } + + @Override + public void deleteErpMonthProductivePlanCheck(Long id) { + // 校验存在 + validateErpMonthProductivePlanCheckExists(id); + // 删除 + erpMonthProductivePlanCheckMapper.deleteById(id); + } + + @Override + public void deleteErpMonthProductivePlanCheckListByIds(List ids) { + // 校验存在 + validateErpMonthProductivePlanCheckExists(ids); + // 删除 + erpMonthProductivePlanCheckMapper.deleteByIds(ids); + } + + private void validateErpMonthProductivePlanCheckExists(List ids) { + List list = erpMonthProductivePlanCheckMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(ERP_MONTH_PRODUCTIVE_PLAN_CHECK_NOT_EXISTS); + } + } + + private void validateErpMonthProductivePlanCheckExists(Long id) { + if (erpMonthProductivePlanCheckMapper.selectById(id) == null) { + throw exception(ERP_MONTH_PRODUCTIVE_PLAN_CHECK_NOT_EXISTS); + } + } + + @Override + public ErpMonthProductivePlanCheckDO getErpMonthProductivePlanCheck(Long id) { + return erpMonthProductivePlanCheckMapper.selectById(id); + } + + @Override + public PageResult getErpMonthProductivePlanCheckPage(ErpMonthProductivePlanCheckPageReqVO pageReqVO) { + return erpMonthProductivePlanCheckMapper.selectPage(pageReqVO); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void createBatchErpMonthProductivePlanCheck(List createReqVOList) { + if (createReqVOList == null || createReqVOList.isEmpty()) { + throw exception(DATA_NOT_ERROR); + } + createReqVOList.forEach(createReqVO -> { + ErpMonthProductivePlanCheckDO erpMonthProductivePlanCheck = BeanUtils.toBean(createReqVO, ErpMonthProductivePlanCheckDO.class); + erpMonthProductivePlanCheckMapper.insert(erpMonthProductivePlanCheck); + if (createReqVO.getDetails() != null && !createReqVO.getDetails().isEmpty()) { + createReqVO.getDetails().forEach(detail -> detail.setMainId(erpMonthProductivePlanCheck.getId())); + erpMonthProductivePlanCheckDetailService.createErpMonthProductivePlanCheckDetail(createReqVO.getDetails()); + } + }); + } + + @Override + public List getErpMonthProductivePlanCheckDetail(Long id) { + return setErpMonthProductivePlanCheckDetailData(id); + } + + private List setErpMonthProductivePlanCheckDetailData(Long id){ + if (id == null){ + return new ArrayList<>(); + } + return erpMonthProductivePlanCheckDetailService.getErpMonthProductivePlanCheckDetailListByMainId(id); + } + +} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/service/plandate/PlanOrderService.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/service/plandate/PlanOrderService.java new file mode 100644 index 00000000..a155c97b --- /dev/null +++ b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/service/plandate/PlanOrderService.java @@ -0,0 +1,20 @@ +package com.zt.plat.module.base.service.plandate; + +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.module.base.controller.admin.plandate.vo.PlanDateRespVO; +import com.zt.plat.module.base.controller.admin.plandate.vo.PlanOrderRspVO; +import com.zt.plat.module.base.controller.admin.plandate.vo.PlanOrderSaveReqVO; +import com.zt.plat.module.contractorder.api.dto.order.OrderAndPlanDataReqDTO; +import com.zt.plat.module.contractorder.api.dto.order.OrderDTO; + +public interface PlanOrderService { + + PlanOrderRspVO bindOrder(PlanOrderSaveReqVO reqVO); + + void unbindOrder(String planId, String orderNumber); + + PageResult getBoundOrder(String id); + + + PageResult queryOrderAndPlanData(OrderAndPlanDataReqDTO reqVO); +} diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/service/plandate/PlanOrderServiceImpl.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/service/plandate/PlanOrderServiceImpl.java new file mode 100644 index 00000000..20685a31 --- /dev/null +++ b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/service/plandate/PlanOrderServiceImpl.java @@ -0,0 +1,74 @@ +package com.zt.plat.module.base.service.plandate; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.module.base.controller.admin.plandate.vo.PlanDateRespVO; +import com.zt.plat.module.base.controller.admin.plandate.vo.PlanOrderRspVO; +import com.zt.plat.module.base.controller.admin.plandate.vo.PlanOrderSaveReqVO; +import com.zt.plat.module.base.dal.dao.plandate.PlanOrderMapper; +import com.zt.plat.module.base.dal.dataobject.plandate.PlanOrderDO; +import com.zt.plat.module.contractorder.api.OrderApi; +import com.zt.plat.module.contractorder.api.dto.order.OrderAndPlanDataReqDTO; +import com.zt.plat.module.contractorder.api.dto.order.OrderDTO; +import jakarta.annotation.Resource; +import org.springframework.stereotype.Service; +import org.springframework.validation.annotation.Validated; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.module.base.enums.ErrorCodeConstants.*; + +@Service +@Validated +public class PlanOrderServiceImpl implements PlanOrderService { + @Resource + private PlanOrderMapper planOrderMapper; + + @Resource + private OrderApi orderApi; + + @Override + public PlanOrderRspVO bindOrder(PlanOrderSaveReqVO reqVO) { + PlanOrderDO bean = BeanUtils.toBean(reqVO, PlanOrderDO.class); + //校验当前计划下是否已存在该类型的订单 + validateExists(reqVO); + planOrderMapper.insert(bean); + return BeanUtils.toBean(bean, PlanOrderRspVO.class); + } + + + @Override + public void unbindOrder(String planId, String orderNumber) { + //检验存在 + validateExists(planId, orderNumber); + planOrderMapper.delete(new LambdaQueryWrapper().eq(PlanOrderDO::getPlanId, planId).eq(PlanOrderDO::getOrderNumber, orderNumber)); + } + + @Override + public PageResult getBoundOrder(String id) { + OrderAndPlanDataReqDTO reqVO = new OrderAndPlanDataReqDTO(); + reqVO.setPlanId(id); + CommonResult> pageResultCommonResult = orderApi.queryOrderPlanData(reqVO); + return pageResultCommonResult.getData(); + } + + @Override + public PageResult queryOrderAndPlanData(OrderAndPlanDataReqDTO reqVO) { + CommonResult> pageResultCommonResult = orderApi.queryOrderPlanData(reqVO); + return pageResultCommonResult.getData(); + } + + private void validateExists(PlanOrderSaveReqVO reqVO) { + if (planOrderMapper.exists(new LambdaQueryWrapper().eq(PlanOrderDO::getPlanId, reqVO.getPlanId()).eq(PlanOrderDO::getOrderType, reqVO.getOrderType()).eq(PlanOrderDO::getOrderNumber, reqVO.getOrderNumber()))) { + throw exception(PLAN_ORD_EXISTS); + } + } + + private void validateExists(String planId, String orderNumber) { + if (planOrderMapper.selectOne(new LambdaQueryWrapper().eq(PlanOrderDO::getPlanId, planId).eq(PlanOrderDO::getOrderNumber, orderNumber),false) == null) { + throw exception(PLAN_ORD_NOT_EXISTS); + } + } +} + diff --git a/zt-module-base/zt-module-base-server/src/main/resources/mapper/erpmonthproductiveplancheck/ErpMonthProductivePlanCheckDetailMapper.xml b/zt-module-base/zt-module-base-server/src/main/resources/mapper/erpmonthproductiveplancheck/ErpMonthProductivePlanCheckDetailMapper.xml new file mode 100644 index 00000000..458dfc12 --- /dev/null +++ b/zt-module-base/zt-module-base-server/src/main/resources/mapper/erpmonthproductiveplancheck/ErpMonthProductivePlanCheckDetailMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/resources/mapper/erpmonthproductiveplancheck/ErpMonthProductivePlanCheckMapper.xml b/zt-module-base/zt-module-base-server/src/main/resources/mapper/erpmonthproductiveplancheck/ErpMonthProductivePlanCheckMapper.xml new file mode 100644 index 00000000..ea5dd2d6 --- /dev/null +++ b/zt-module-base/zt-module-base-server/src/main/resources/mapper/erpmonthproductiveplancheck/ErpMonthProductivePlanCheckMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-contract-order/zt-module-contract-order-api/src/main/java/com/zt/plat/module/contractorder/api/OrderApi.java b/zt-module-contract-order/zt-module-contract-order-api/src/main/java/com/zt/plat/module/contractorder/api/OrderApi.java index 2c6aa4da..4cce3700 100644 --- a/zt-module-contract-order/zt-module-contract-order-api/src/main/java/com/zt/plat/module/contractorder/api/OrderApi.java +++ b/zt-module-contract-order/zt-module-contract-order-api/src/main/java/com/zt/plat/module/contractorder/api/OrderApi.java @@ -1,6 +1,8 @@ package com.zt.plat.module.contractorder.api; import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.module.contractorder.api.dto.order.OrderAndPlanDataReqDTO; import com.zt.plat.module.contractorder.api.dto.order.OrderDTO; import com.zt.plat.module.contractorder.api.dto.order.SalesOrdDtlDTO; import com.zt.plat.module.contractorder.api.dto.order.UpdateOrderLstQtyDTO; @@ -44,4 +46,8 @@ public interface OrderApi { @GetMapping(PREFIX + "/get-salas-order-details-by-id") @Operation(summary = "通过销售订单明细id获取销售订单详情", description = "通过销售订单明细id获取销售订单详情") CommonResult getSalesOrderDetailsByOrderId(@RequestParam("id") Long id); + + @PostMapping(PREFIX + "/query-order-plan-data") + @Operation(summary = "根据计划和订单的参数查询相关的订单", description = "根据计划和订单的参数查询相关的订单") + CommonResult> queryOrderPlanData(@RequestBody @Valid OrderAndPlanDataReqDTO reqVO); } diff --git a/zt-module-contract-order/zt-module-contract-order-api/src/main/java/com/zt/plat/module/contractorder/api/dto/order/OrderAndPlanDataReqDTO.java b/zt-module-contract-order/zt-module-contract-order-api/src/main/java/com/zt/plat/module/contractorder/api/dto/order/OrderAndPlanDataReqDTO.java new file mode 100644 index 00000000..40152226 --- /dev/null +++ b/zt-module-contract-order/zt-module-contract-order-api/src/main/java/com/zt/plat/module/contractorder/api/dto/order/OrderAndPlanDataReqDTO.java @@ -0,0 +1,41 @@ +package com.zt.plat.module.contractorder.api.dto.order; +import com.zt.plat.framework.common.pojo.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotEmpty; +import lombok.Data; +import org.springframework.validation.annotation.Validated; + +@Data +@Schema(description = "订单和计划数据请求DTO") +@Validated +public class OrderAndPlanDataReqDTO extends PageParam { + //合同编号 + @Schema(description = "合同编号") + private String contractSystemNumber; + //纸质合同编号 + @Schema(description = "纸质合同编号") + private String paperContractNumber; + //订单号 + @Schema(description = "订单号") + private String orderNumber; + //订单分类 + @Schema(description = "订单分类") + //@NotEmpty(message = "订单分类不能为空") + private String orderType; + //物料编码 + @Schema(description = "物料编码") + private String materialNumber; + //物料名称 + @Schema(description = "物料名称") + private String materialName; + //客商编码 + @Schema(description = "客商编码") + private String customerNumber; + //客商名称 + @Schema(description = "客商名称") + private String customerName; + //计划编号 + @Schema(description = "计划编号") + @NotEmpty(message = "计划Id不能为空") + private String planId; +} diff --git a/zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/api/OrderApiImpl.java b/zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/api/OrderApiImpl.java index 52d2fe34..9b4b6c88 100644 --- a/zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/api/OrderApiImpl.java +++ b/zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/api/OrderApiImpl.java @@ -3,6 +3,7 @@ package com.zt.plat.module.contractorder.api; import cn.hutool.extra.spring.SpringUtil; import com.zt.plat.framework.common.exception.ErrorCode; import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.common.util.object.BeanUtils; import com.zt.plat.module.contractorder.api.dto.order.*; import com.zt.plat.module.contractorder.dal.dataobject.purchaseorder.PrchOrdDtlDO; @@ -183,6 +184,13 @@ public class OrderApiImpl implements OrderApi { return success(BeanUtils.toBean(salesOrderDetailDOS, SalesOrdDtlDTO.class)); } + @Override + public CommonResult> queryOrderPlanData(OrderAndPlanDataReqDTO reqVO) { + PageResult pageResult = purchaseOrderService.queryOrderAndPlanData(reqVO); + List bean = BeanUtils.toBean(pageResult.getList(), OrderDTO.class); + return success(new PageResult<>(bean, pageResult.getTotal())); + } + private List getOrderByIds(List ids) { return SpringUtil.getBean(SalesOrderMapper.class).selectByIds(ids); // 采购订单与销售订单的 } diff --git a/zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/controller/admin/purchaseorder/PurchaseOrderController.java b/zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/controller/admin/purchaseorder/PurchaseOrderController.java index 8b09d40a..562a81b5 100644 --- a/zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/controller/admin/purchaseorder/PurchaseOrderController.java +++ b/zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/controller/admin/purchaseorder/PurchaseOrderController.java @@ -52,14 +52,14 @@ public class PurchaseOrderController implements BusinessControllerMarker { @PostMapping("/create") @Operation(summary = "创建采购订单") - @PreAuthorize("@ss.hasPermission('base:purchase-order:create')") + @PreAuthorize("@ss.hasAnyPermissions('base:purchase-order:create','purchase:order:list:OrderList:add')") public CommonResult createPurchaseOrder(@Valid @RequestBody PurchaseOrderSaveReqVO createReqVO) { return success(purchaseOrderService.createPurchaseOrder(createReqVO)); } @PutMapping("/update") @Operation(summary = "更新采购订单") - @PreAuthorize("@ss.hasPermission('base:purchase-order:update')") + @PreAuthorize("@ss.hasAnyPermissions('base:purchase-order:update','purchase:order:list:OrderList:edit')") public CommonResult updatePurchaseOrder(@Valid @RequestBody PurchaseOrderSaveReqVO updateReqVO) { purchaseOrderService.updatePurchaseOrder(updateReqVO); return success(true); @@ -68,7 +68,7 @@ public class PurchaseOrderController implements BusinessControllerMarker { @DeleteMapping("/delete") @Operation(summary = "删除采购订单") @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('base:purchase-order:delete')") + @PreAuthorize("@ss.hasAnyPermissions('base:purchase-order:delete','purchase:order:list:OrderList:delete')") public CommonResult deletePurchaseOrder(@RequestParam("id") Long id) { purchaseOrderService.deletePurchaseOrder(id); return success(true); @@ -77,7 +77,7 @@ public class PurchaseOrderController implements BusinessControllerMarker { @DeleteMapping("/delete-list") @Parameter(name = "ids", description = "编号", required = true) @Operation(summary = "批量删除采购订单") - @PreAuthorize("@ss.hasPermission('base:purchase-order:delete')") + @PreAuthorize("@ss.hasAnyPermissions('base:purchase-order:delete','purchase:order:list:OrderList:delete')") public CommonResult deletePurchaseOrderList(@RequestBody BatchDeleteReqVO req) { purchaseOrderService.deletePurchaseOrderListByIds(req.getIds()); return success(true); @@ -86,7 +86,7 @@ public class PurchaseOrderController implements BusinessControllerMarker { @GetMapping("/get") @Operation(summary = "获得采购订单") @Parameter(name = "id", description = "id是订单主键,splyBsnTp是订单类型采购或者是消费", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('base:purchase-order:query')") + @PreAuthorize("@ss.hasAnyPermissions('base:purchase-order:query')") public CommonResult getPurchaseOrder(@RequestParam("id") Long id, @RequestParam(value = "splyBsnTp", required = false) String splyBsnTp) { PurchaseOrderDO purchaseOrder = purchaseOrderService.getPurchaseOrder(id, splyBsnTp); PurchaseOrderRespVO purchaseOrderRespVO = BeanUtils.toBean(purchaseOrder, PurchaseOrderRespVO.class); @@ -99,7 +99,7 @@ public class PurchaseOrderController implements BusinessControllerMarker { @GetMapping("/page") @Operation(summary = "获得采购订单分页") - @PreAuthorize("@ss.hasPermission('base:purchase-order:query')") + @PreAuthorize("@ss.hasAnyPermissions('base:purchase-order:query')") public CommonResult> getPurchaseOrderPage(@Valid PurchaseOrderPageReqVO pageReqVO) { PageResult pageResult = purchaseOrderService.getPurchaseOrderPage(pageReqVO); PageResult purchaseOrderRespVOPageResult = BeanUtils.toBean(pageResult, PurchaseOrderRespVO.class); @@ -112,7 +112,7 @@ public class PurchaseOrderController implements BusinessControllerMarker { @GetMapping("/export-excel") @Operation(summary = "导出采购订单 Excel") - @PreAuthorize("@ss.hasPermission('base:purchase-order:export')") + @PreAuthorize("@ss.hasAnyPermissions('base:purchase-order:export')") @ApiAccessLog(operateType = EXPORT) public void exportPurchaseOrderExcel(@Valid PurchaseOrderPageReqVO pageReqVO, HttpServletResponse response) throws IOException { @@ -126,7 +126,7 @@ public class PurchaseOrderController implements BusinessControllerMarker { //提交订单审核 @PostMapping("/submit-order") @Operation(summary = "提交订单审核") - @PreAuthorize("@ss.hasPermission('base:purchase-order:update')") + @PreAuthorize("@ss.hasAnyPermissions('base:purchase-order:update','purchase:order:list:OrderList:edit')") public CommonResult submitOrder(@RequestParam("id") String id) { purchaseOrderService.submitOrder(Long.valueOf(id)); return success(true); @@ -134,7 +134,7 @@ public class PurchaseOrderController implements BusinessControllerMarker { @PostMapping("/submit-order-batch") @Operation(summary = "批量提交订单审核") - @PreAuthorize("@ss.hasPermission('base:purchase-order:update')") + @PreAuthorize("@ss.hasAnyPermissions('base:purchase-order:update','purchase:order:list:OrderList:edit')") public CommonResult submitOrder(@RequestBody @Validated @NotEmpty(message = "采购订单id不能为空") List ids) { System.out.println("ids:" + ids); ids.forEach(id -> purchaseOrderService.submitOrder(Long.valueOf(id))); @@ -144,7 +144,7 @@ public class PurchaseOrderController implements BusinessControllerMarker { //提交ERP订单 @PostMapping("/submit-erp061") @Operation(summary = "推送ERP订单", description = "061')") - @PreAuthorize("@ss.hasPermission('base:purchase-order:update')") + @PreAuthorize("@ss.hasAnyPermissions('base:purchase-order:update','purchase:order:list:OrderList:edit')") public CommonResult submitErp061(@RequestBody @Validated @NotEmpty(message = "采购订单id不能为空") List idsStr) { List ids = idsStr.stream().map(Long::valueOf).toList(); // todo 推送ERP订单 @@ -153,7 +153,7 @@ public class PurchaseOrderController implements BusinessControllerMarker { @PostMapping("/submit-erp062") @Operation(summary = "推送ERP订单", description = "062当每次调更新接口后都需要调此接口") - @PreAuthorize("@ss.hasPermission('base:purchase-order:update')") + @PreAuthorize("@ss.hasAnyPermissions('base:purchase-order:update','purchase:order:list:OrderList:edit')") public CommonResult submitErp062(@RequestParam @Validated @NotNull(message = "采购订单id不能为空") String id) { // todo 推送ERP订单 return success(purchaseOrderService.submitErp062(Long.valueOf(id))); @@ -162,7 +162,7 @@ public class PurchaseOrderController implements BusinessControllerMarker { //通过订单号查询订单信息 @PostMapping("/get-order-by-order-no") @Operation(summary = "通过订单号查询订单信息", description = "通过订单号查询订单信息") - @PreAuthorize("@ss.hasPermission('base:purchase-order:query')") + @PreAuthorize("@ss.hasAnyPermissions('base:purchase-order:query')") public CommonResult> getOrderByOrderNo(@RequestBody @Validated @NotEmpty(message = "采购订单不能为空") List orderNos) { return success(purchaseOrderService.getOrderByOrderNo(orderNos)); } @@ -170,7 +170,7 @@ public class PurchaseOrderController implements BusinessControllerMarker { //根据订单id修改订单状态 @PutMapping("/update-order-status") @Operation(summary = "批量修改订单状态", description = "sts取值于字典名称'采购订单状态',字典类型'PRCH_ORD_STS' 可以根据订单号和订单id修改") - @PreAuthorize("@ss.hasPermission('base:purchase-order:update')") + @PreAuthorize("@ss.hasAnyPermissions('base:purchase-order:update','purchase:order:list:OrderList:edit')") public CommonResult updateOrderStatus(@RequestBody @Validated OrderStsReqVO req) { purchaseOrderService.updateOrderStatusByIdOrOrderNo(req); return success(true); @@ -179,7 +179,7 @@ public class PurchaseOrderController implements BusinessControllerMarker { //查询物料接口 @GetMapping("/material") @Operation(summary = "查询物料接口") - @PreAuthorize("@ss.hasPermission('base:purchase-order:query')") + @PreAuthorize("@ss.hasAnyPermissions('base:purchase-order:query')") public CommonResult getMaterialList(@RequestParam @Schema(description = "采购订单号") @Validated @@ -191,14 +191,14 @@ public class PurchaseOrderController implements BusinessControllerMarker { //关联订单 @PostMapping("/link-order") @Operation(summary = "关联订单") - @PreAuthorize("@ss.hasPermission('base:purchase-order:update')") + @PreAuthorize("@ss.hasAnyPermissions('base:purchase-order:update','purchase:order:list:OrderList:edit')") public CommonResult linkOrder(@RequestBody @Validated LinkOrderReqVO req) { return success(purchaseOrderService.linkOrder(req)); } @PostMapping("/order-pass-reject") @Operation(summary = "订单审核") - @PreAuthorize("@ss.hasPermission('base:purchase-order:update')") + @PreAuthorize("@ss.hasAnyPermissions('base:purchase-order:update','purchase:order:list:OrderList:edit')") public CommonResult orderPassReject(@RequestBody PurchaseorderReqVO reqVO) { return success(purchaseOrderService.orderPassReject(reqVO)); } @@ -206,7 +206,7 @@ public class PurchaseOrderController implements BusinessControllerMarker { //根据订单id和方式获取上或下游订单 @PostMapping("/order-by-order-id-and-type") @Operation(summary = "根据订单id和方式获取上或下游订单") - @PreAuthorize("@ss.hasPermission('base:purchase-order:query')") + @PreAuthorize("@ss.hasAnyPermissions('base:purchase-order:query')") public CommonResult> getOrderByOrderIdAndType(@RequestBody DownOrUpOrderReqVO reqVO) { return success( purchaseOrderService.getOrderByOrderIdAndType(reqVO)); } @@ -214,7 +214,7 @@ public class PurchaseOrderController implements BusinessControllerMarker { @PostMapping("/bound-order") @Operation(summary = "获取已绑定的订单") - @PreAuthorize("@ss.hasPermission('base:purchase-order:query')") + @PreAuthorize("@ss.hasAnyPermissions('base:purchase-order:query')") public CommonResult> boundOrder(@RequestBody DownOrUpOrderReqVO reqVO) { return success(purchaseOrderService.getBindOrderByOrder(reqVO)); } diff --git a/zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/controller/admin/purchaseorder/vo/PurchaseOrderDetailsRespVO.java b/zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/controller/admin/purchaseorder/vo/PurchaseOrderDetailsRespVO.java index 61a62d61..ca54ebcb 100644 --- a/zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/controller/admin/purchaseorder/vo/PurchaseOrderDetailsRespVO.java +++ b/zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/controller/admin/purchaseorder/vo/PurchaseOrderDetailsRespVO.java @@ -177,12 +177,12 @@ public class PurchaseOrderDetailsRespVO { private String reviewOpinion; /** - * 是否需要审批 + * 是否提交审核,value为0或1 */ private int isPush; /** - * 物料类型 + * 物料类别(字典:MTRL_TP) */ private String mtrlTp; @@ -192,7 +192,7 @@ public class PurchaseOrderDetailsRespVO { private List orderDetails; /** - * 订单类型 + * 订单分类(字典:SPLY_BSN_TP) */ private String splyBsnTp; @@ -202,7 +202,7 @@ public class PurchaseOrderDetailsRespVO { private String unt; /** - * 物权转移 + * 货权转移类型(字典:ASY_MTNG_TP) */ private String meteringType; } diff --git a/zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/controller/admin/purchaseorder/vo/PurchaseOrderPageReqVO.java b/zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/controller/admin/purchaseorder/vo/PurchaseOrderPageReqVO.java index 722bd030..b3894f69 100644 --- a/zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/controller/admin/purchaseorder/vo/PurchaseOrderPageReqVO.java +++ b/zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/controller/admin/purchaseorder/vo/PurchaseOrderPageReqVO.java @@ -131,7 +131,7 @@ public class PurchaseOrderPageReqVO extends PageParam { @Schema(description = "物料类型(字典:MTRL_TP)", example = "2") private String mtrlTp; - @Schema(description = "订单分类") + @Schema(description = "订单分类(字典:SPLY_BSN_TP)") private String splyBsnTp; @Schema(description = "货权转移类型(字典:ASY_MTNG_TP)") diff --git a/zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/dal/mysql/purchaseorder/PurchaseOrderMapper.java b/zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/dal/mysql/purchaseorder/PurchaseOrderMapper.java index 2e5cf0ff..bfbf7582 100644 --- a/zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/dal/mysql/purchaseorder/PurchaseOrderMapper.java +++ b/zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/dal/mysql/purchaseorder/PurchaseOrderMapper.java @@ -6,6 +6,7 @@ import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import com.zt.plat.module.contractorder.api.dto.order.OrderAndPlanDataReqDTO; import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.PurchaseOrderPageReqVO; import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.PurchaseOrderWithDetailsVO; import com.zt.plat.module.contractorder.dal.dataobject.purchaseorder.PurchaseOrderDO; @@ -71,4 +72,6 @@ public interface PurchaseOrderMapper extends BaseMapperX { List selectOrderByIds(@Param("ids") List id); PurchaseOrderDO selectByOrderId(@Param("orderId") Long orderId); + + List queryOrderAndPlanData(OrderAndPlanDataReqDTO reqDTO); } diff --git a/zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/service/purchaseorder/PurchaseOrderService.java b/zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/service/purchaseorder/PurchaseOrderService.java index 6e9590b2..c019833c 100644 --- a/zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/service/purchaseorder/PurchaseOrderService.java +++ b/zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/service/purchaseorder/PurchaseOrderService.java @@ -3,6 +3,7 @@ package com.zt.plat.module.contractorder.service.purchaseorder; import java.util.*; import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.module.contractorder.api.dto.order.OrderAndPlanDataReqDTO; import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.*; import com.zt.plat.module.contractorder.controller.admin.salesorder.vo.SalesOrderSaveReqVO; import com.zt.plat.module.contractorder.dal.dataobject.purchaseorder.PurchaseOrderDO; @@ -145,4 +146,12 @@ public interface PurchaseOrderService { * @return 订单详情 */ List getOrdersByIds(List ids); + + /** + * 查询订单和计划数据 + * + * @param reqDTO 查询条件 + * @return 订单和计划数据 + */ + PageResult queryOrderAndPlanData(OrderAndPlanDataReqDTO reqDTO); } diff --git a/zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/service/purchaseorder/PurchaseOrderServiceImpl.java b/zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/service/purchaseorder/PurchaseOrderServiceImpl.java index 8fce6292..be6bc10f 100644 --- a/zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/service/purchaseorder/PurchaseOrderServiceImpl.java +++ b/zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/service/purchaseorder/PurchaseOrderServiceImpl.java @@ -13,6 +13,7 @@ import com.zt.plat.module.bpm.api.task.BpmProcessInstanceApi; import com.zt.plat.module.bpm.api.task.BpmTaskApi; import com.zt.plat.module.bpm.api.task.dto.*; import com.zt.plat.module.bpm.enums.task.BpmProcessInstanceStatusEnum; +import com.zt.plat.module.contractorder.api.dto.order.OrderAndPlanDataReqDTO; import com.zt.plat.module.contractorder.api.vo.contract.ContractRespVO; import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.*; import com.zt.plat.module.contractorder.dal.dataobject.contract.SystemRelativityDO; @@ -698,6 +699,8 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService { return purchaseOrderMapper.selectByIds(ids); } + + @Override @Transactional(rollbackFor=Exception.class) public boolean orderPassReject(PurchaseorderReqVO purchaseorderReqVO) { @@ -788,4 +791,24 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService { int number = (int) (Math.random() * 900000 + 100000); return String.valueOf(number); } + + @Override + public PageResult queryOrderAndPlanData(OrderAndPlanDataReqDTO reqDTO) { + // 1. 查询所有符合条件的数据 + List allData = purchaseOrderMapper.queryOrderAndPlanData(reqDTO); + + // 2. 获取分页参数 + Integer pageSize = reqDTO.getPageSize(); + Integer pageNum = reqDTO.getPageNo(); + + // 3. 计算分页截取的起始/结束索引 + int startIndex = (pageNum - 1) * pageSize; + int endIndex = Math.min(startIndex + pageSize, allData.size()); + + // 4. 截取当前页数据(索引越界时返回空列表) + List pageData = startIndex >= allData.size() + ? new ArrayList<>() + : allData.subList(startIndex, endIndex); + return new PageResult<>(pageData, (long) allData.size()); + } } diff --git a/zt-module-contract-order/zt-module-contract-order-server/src/main/resources/mapper/purchaseorder/PurchaseOrderMapper.xml b/zt-module-contract-order/zt-module-contract-order-server/src/main/resources/mapper/purchaseorder/PurchaseOrderMapper.xml index ffba659c..67916f0d 100644 --- a/zt-module-contract-order/zt-module-contract-order-server/src/main/resources/mapper/purchaseorder/PurchaseOrderMapper.xml +++ b/zt-module-contract-order/zt-module-contract-order-server/src/main/resources/mapper/purchaseorder/PurchaseOrderMapper.xml @@ -237,17 +237,23 @@ - + - + - + @@ -298,7 +304,8 @@ - + @@ -346,4 +353,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +