计划相关Feign接口
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user