计划管理相关功能实现

This commit is contained in:
潘荣晟
2026-01-19 17:31:52 +08:00
parent bee606926a
commit 6602fcd6e3
36 changed files with 1559 additions and 7 deletions

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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<ErpMonthProductivePlanCheckDetailRespVO> details;
}

View File

@@ -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<ErpMonthProductivePlanCheckDetailSaveReqVO> details;
}

View File

@@ -113,7 +113,7 @@ public class PlanDateController implements BusinessControllerMarker {
@GetMapping("/tree/list-all")
@Operation(summary = "查询所有计划数据(树形结构)")
@PreAuthorize("@ss.hasPermission('base:plan-date:query')")
public List<PlanDateRespVO> listAllPlanDateTree() {
return planDateService.listPlanDateTree();
public CommonResult<List<PlanDateRespVO>> listAllPlanDateTree() {
return success(planDateService.listPlanDateTree());
}
}

View File

@@ -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<PageResult<OrderDTO>> queryOrder(@RequestBody OrderAndPlanDataReqDTO reqVO) {
return success(planOrderService.queryOrderAndPlanData(reqVO));
}
}

Some files were not shown because too many files have changed in this diff Show More