计划相关Feign接口

This commit is contained in:
潘荣晟
2026-02-10 15:54:46 +08:00
parent 7ccb6e09e2
commit 70634dbb6d
13 changed files with 361 additions and 1 deletions

View File

@@ -0,0 +1,24 @@
package com.zt.plat.module.plandate;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.module.base.enums.ApiConstants;
import com.zt.plat.module.plandate.dto.ErpMonthProductivePlanCheckSaveReqDTO;
import com.zt.plat.module.plandate.dto.PlanDateSaveReqDTO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
@FeignClient(name = ApiConstants.NAME)
@Tag(name = "RPC 服务 - base")
public interface PlanApi {
String PREFIX = ApiConstants.PREFIX + "/api/plan";
@PostMapping(PREFIX + "/create")
@Operation(summary = "计划创建")
CommonResult<Boolean> planCreate(PlanDateSaveReqDTO reqDTO);
@PostMapping(PREFIX + "/monthProductivePlanCheckCreate")
@Operation(summary = "月 productive plan check 创建")
CommonResult<Boolean> monthProductivePlanCheckCreate(ErpMonthProductivePlanCheckSaveReqDTO reqDTO);
}

View File

@@ -0,0 +1,51 @@
package com.zt.plat.module.plandate.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.validation.annotation.Validated;
import java.math.BigDecimal;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - ERP月度产品计划核对明细新增 Request DTO")
@Data
@Validated
public class ErpMonthProductivePlanCheckDetailSaveReqDTO {
@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;
@Schema(description = "公司ID")
private Long companyId;
@Schema(description = "公司名称")
private String companyName;
@Schema(description = "部门ID")
private Long deptId;
@Schema(description = "部门名称")
private Long postId;
@Schema(description = "岗位ID")
private Long tenantId;
@Schema(description = "创建人名称")
private String creatorName;
@Schema(description = "更新人名称")
private String updaterName;
@Schema(description = "创建时间")
private LocalDateTime createTime;
@Schema(description = "更新时间")
private LocalDateTime updateTime;
@Schema(description = "删除标志")
private int deleted;
}

View File

@@ -0,0 +1,54 @@
package com.zt.plat.module.plandate.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.validation.annotation.Validated;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
@Schema(description = "管理后台 - ERP月度产品计划核对新增 Request DTO")
@Data
@Validated
public class ErpMonthProductivePlanCheckSaveReqDTO {
@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<ErpMonthProductivePlanCheckDetailSaveReqDTO> details;
@Schema(description = "公司ID")
private Long companyId;
@Schema(description = "公司名称")
private String companyName;
@Schema(description = "部门ID")
private Long deptId;
@Schema(description = "部门名称")
private Long postId;
@Schema(description = "岗位ID")
private Long tenantId;
@Schema(description = "创建人名称")
private String creatorName;
@Schema(description = "更新人名称")
private String updaterName;
@Schema(description = "创建时间")
private LocalDateTime createTime;
@Schema(description = "更新时间")
private LocalDateTime updateTime;
@Schema(description = "删除标志")
private int deleted;
}

View File

@@ -0,0 +1,36 @@
package com.zt.plat.module.base.api.plan;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.framework.common.util.object.BeanUtils;
import com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo.ErpMonthProductivePlanCheckSaveReqVO;
import com.zt.plat.module.base.controller.admin.plandate.vo.PlanDateSaveReqVO;
import com.zt.plat.module.base.service.erpmonthproductiveplancheck.ErpMonthProductivePlanCheckService;
import com.zt.plat.module.base.service.plandate.PlanDateService;
import com.zt.plat.module.plandate.PlanApi;
import com.zt.plat.module.plandate.dto.ErpMonthProductivePlanCheckSaveReqDTO;
import com.zt.plat.module.plandate.dto.PlanDateSaveReqDTO;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RestController;
@RestController
@Validated
public class PlanApiImpl implements PlanApi {
@Resource
private PlanDateService planDateService;
@Resource
private ErpMonthProductivePlanCheckService erpMonthProductivePlanCheckService;
@Override
public CommonResult<Boolean> planCreate(PlanDateSaveReqDTO reqDTO) {
PlanDateSaveReqVO planDateSaveReqVO = BeanUtils.toBean(reqDTO, PlanDateSaveReqVO.class);
planDateService.createPlanDate(planDateSaveReqVO);
return CommonResult.success(true);
}
@Override
public CommonResult<Boolean> monthProductivePlanCheckCreate(ErpMonthProductivePlanCheckSaveReqDTO reqDTO) {
ErpMonthProductivePlanCheckSaveReqVO erpMonthProductivePlanCheckSaveReqVO = BeanUtils.toBean(reqDTO, ErpMonthProductivePlanCheckSaveReqVO.class);
erpMonthProductivePlanCheckService.createErpMonthProductivePlanCheck(erpMonthProductivePlanCheckSaveReqVO);
return CommonResult.success(true);
}
}

View File

@@ -2,6 +2,8 @@ package com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.time.LocalDateTime;
import java.util.*;
import jakarta.validation.constraints.*;
import java.math.BigDecimal;
@@ -25,4 +27,25 @@ public class ErpMonthProductivePlanCheckDetailSaveReqVO {
@Schema(description = "主数据ID关联主表ID", example = "3745")
private Long mainId;
@Schema(description = "公司ID")
private Long companyId;
@Schema(description = "公司名称")
private String companyName;
@Schema(description = "部门ID")
private Long deptId;
@Schema(description = "部门名称")
private Long postId;
@Schema(description = "岗位ID")
private Long tenantId;
@Schema(description = "创建人名称")
private String creatorName;
@Schema(description = "更新人名称")
private String updaterName;
@Schema(description = "创建时间")
private LocalDateTime createTime;
@Schema(description = "更新时间")
private LocalDateTime updateTime;
@Schema(description = "删除标志")
private int deleted;
}

View File

@@ -2,6 +2,8 @@ package com.zt.plat.module.base.controller.admin.erpmonthproductiveplancheck.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.time.LocalDateTime;
import java.util.*;
import jakarta.validation.constraints.*;
import java.math.BigDecimal;
@@ -27,5 +29,25 @@ public class ErpMonthProductivePlanCheckSaveReqVO {
@Schema(description = "月计划明细")
private List<ErpMonthProductivePlanCheckDetailSaveReqVO> details;
@Schema(description = "公司ID")
private Long companyId;
@Schema(description = "公司名称")
private String companyName;
@Schema(description = "部门ID")
private Long deptId;
@Schema(description = "部门名称")
private Long postId;
@Schema(description = "岗位ID")
private Long tenantId;
@Schema(description = "创建人名称")
private String creatorName;
@Schema(description = "更新人名称")
private String updaterName;
@Schema(description = "创建时间")
private LocalDateTime createTime;
@Schema(description = "更新时间")
private LocalDateTime updateTime;
@Schema(description = "删除标志")
private int deleted;
}

View File

@@ -5,6 +5,9 @@ import com.zt.plat.module.base.controller.admin.plandate.vo.PlanDateRespVO;
import com.zt.plat.module.base.controller.admin.plandate.vo.PlanDateSaveReqVO;
import com.zt.plat.module.base.dal.dataobject.plandate.PlanDateDO;
import com.zt.plat.module.base.service.plandate.PlanDateService;
import com.zt.plat.module.plandate.PlanApi;
import com.zt.plat.module.plandate.dto.ErpMonthProductivePlanCheckSaveReqDTO;
import com.zt.plat.module.plandate.dto.PlanDateSaveReqDTO;
import org.springframework.web.bind.annotation.*;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
@@ -46,6 +49,8 @@ public class PlanDateController implements BusinessControllerMarker {
@Resource
private PlanDateService planDateService;
@Resource
private PlanApi planApi;
@PostMapping("/create")
@Operation(summary = "创建计划数据")
@@ -116,4 +121,8 @@ public class PlanDateController implements BusinessControllerMarker {
public CommonResult<List<PlanDateRespVO>> listAllPlanDateTree(@Valid PlanDatePageReqVO pageReqVO) {
return success(planDateService.listPlanDateTree(pageReqVO));
}
@PostMapping("/planApi")
public CommonResult<?> planApi(@RequestBody ErpMonthProductivePlanCheckSaveReqDTO reqDTO) {
return success(planApi.monthProductivePlanCheckCreate(reqDTO));
}
}

View File

@@ -2,6 +2,8 @@ package com.zt.plat.module.base.controller.admin.plandate.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.time.LocalDateTime;
import java.util.*;
import jakarta.validation.constraints.*;
import java.math.BigDecimal;
@@ -74,5 +76,25 @@ public class PlanDateSaveReqVO {
@Schema(description = "子节点")
private List<PlanDateSaveReqVO> children;
@Schema(description = "公司ID")
private Long companyId;
@Schema(description = "公司名称")
private String companyName;
@Schema(description = "部门ID")
private Long deptId;
@Schema(description = "部门名称")
private Long postId;
@Schema(description = "岗位ID")
private Long tenantId;
@Schema(description = "创建人名称")
private String creatorName;
@Schema(description = "更新人名称")
private String updaterName;
@Schema(description = "创建时间")
private LocalDateTime createTime;
@Schema(description = "更新时间")
private LocalDateTime updateTime;
@Schema(description = "删除标志")
private int deleted;
}

View File

@@ -62,7 +62,10 @@ public class PlanOrderServiceImpl implements PlanOrderService {
}
private void validateExists(PlanOrderSaveReqVO reqVO) {
if (planOrderMapper.exists(new LambdaQueryWrapper<PlanOrderDO>().eq(PlanOrderDO::getPlanId, reqVO.getPlanId()).eq(PlanOrderDO::getOrderType, reqVO.getOrderType()).eq(PlanOrderDO::getOrderNumber, reqVO.getOrderNumber()))) {
if (planOrderMapper.exists(new LambdaQueryWrapper<PlanOrderDO>()
.eq(PlanOrderDO::getPlanId, reqVO.getPlanId())
.eq(PlanOrderDO::getOrderType, reqVO.getOrderType())
.eq(PlanOrderDO::getOrderNumber, reqVO.getOrderNumber()))) {
throw exception(PLAN_ORD_EXISTS);
}
}

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