feat: 增加LMS日计划管理接口
This commit is contained in:
@@ -0,0 +1,201 @@
|
|||||||
|
package cn.code.nl.module.lms.controller.admin.dailyplan;
|
||||||
|
|
||||||
|
import cn.code.nl.framework.common.pojo.CommonResult;
|
||||||
|
import cn.code.nl.framework.common.pojo.PageResult;
|
||||||
|
import cn.code.nl.module.lms.controller.admin.dailyplan.vo.*;
|
||||||
|
import cn.code.nl.module.lms.service.dailyplan.DailyPlanService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import jakarta.validation.Valid;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import org.dromara.core.trans.anno.TransMethodResult;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static cn.code.nl.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
/** 管理后台 - LMS 日计划。 */
|
||||||
|
@Tag(name = "管理后台 - LMS 日计划")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/lms/daily-plan")
|
||||||
|
@Validated
|
||||||
|
public class DailyPlanController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private DailyPlanService dailyPlanService;
|
||||||
|
|
||||||
|
@GetMapping("/managementPage")
|
||||||
|
@Operation(summary = "获得日计划管理分页")
|
||||||
|
@TransMethodResult
|
||||||
|
@PreAuthorize("@ss.hasPermission('lms:daily-plan:query')")
|
||||||
|
public CommonResult<PageResult<DailyPlanRespVO>> getManagementPage(@Valid DailyPlanPageReqVO reqVO) {
|
||||||
|
return success(dailyPlanService.getManagementPage(reqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/workPage")
|
||||||
|
@Operation(summary = "获得日计划作业分页")
|
||||||
|
@TransMethodResult
|
||||||
|
@PreAuthorize("@ss.hasPermission('lms:daily-plan:query')")
|
||||||
|
public CommonResult<PageResult<DailyPlanRespVO>> getWorkPage(@Valid DailyPlanWorkPageReqVO reqVO) {
|
||||||
|
return success(dailyPlanService.getWorkPage(reqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得日计划详情")
|
||||||
|
@Parameter(name = "id", description = "日计划标识", required = true)
|
||||||
|
@TransMethodResult
|
||||||
|
@PreAuthorize("@ss.hasPermission('lms:daily-plan:query')")
|
||||||
|
public CommonResult<DailyPlanRespVO> getDailyPlan(@RequestParam("id") @NotNull Long id) {
|
||||||
|
return success(dailyPlanService.getDailyPlan(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/operationLogList")
|
||||||
|
@Operation(summary = "获得日计划操作日志")
|
||||||
|
@Parameter(name = "id", description = "日计划标识", required = true)
|
||||||
|
@TransMethodResult
|
||||||
|
@PreAuthorize("@ss.hasPermission('lms:daily-plan:query')")
|
||||||
|
public CommonResult<List<DailyPlanOperationLogRespVO>> getOperationLogList(
|
||||||
|
@RequestParam("id") @NotNull Long id) {
|
||||||
|
return success(dailyPlanService.getOperationLogs(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/getStrategies")
|
||||||
|
@Operation(summary = "获得日计划调度策略")
|
||||||
|
@TransMethodResult
|
||||||
|
@PreAuthorize("@ss.hasPermission('lms:daily-plan:query')")
|
||||||
|
public CommonResult<List<DailyPlanStrategyRespVO>> getStrategies() {
|
||||||
|
return success(dailyPlanService.getStrategies());
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "人工创建日计划")
|
||||||
|
@PreAuthorize("@ss.hasPermission('lms:daily-plan:create')")
|
||||||
|
public CommonResult<Long> createDailyPlan(@Valid @RequestBody DailyPlanCreateReqVO reqVO) {
|
||||||
|
return success(dailyPlanService.createManualPlan(reqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "修改人工日计划")
|
||||||
|
@PreAuthorize("@ss.hasPermission('lms:daily-plan:update')")
|
||||||
|
public CommonResult<Boolean> updateDailyPlan(@Valid @RequestBody DailyPlanUpdateReqVO reqVO) {
|
||||||
|
dailyPlanService.updateManualPlan(reqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/startOrder")
|
||||||
|
@Operation(summary = "开始日计划订单")
|
||||||
|
@PreAuthorize("@ss.hasPermission('lms:daily-plan:start')")
|
||||||
|
public CommonResult<Boolean> startOrder(@Valid @RequestBody DailyPlanStartReqVO reqVO) {
|
||||||
|
dailyPlanService.startOrder(reqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/appendQuantity")
|
||||||
|
@Operation(summary = "追加日计划订单数量")
|
||||||
|
@PreAuthorize("@ss.hasPermission('lms:daily-plan:start')")
|
||||||
|
public CommonResult<Boolean> appendQuantity(@Valid @RequestBody DailyPlanAppendReqVO reqVO) {
|
||||||
|
dailyPlanService.appendQuantity(reqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/startStocking")
|
||||||
|
@Operation(summary = "开始备货")
|
||||||
|
@PreAuthorize("@ss.hasPermission('lms:daily-plan:operate')")
|
||||||
|
public CommonResult<Boolean> startStocking(@Valid @RequestBody DailyPlanVersionReqVO reqVO) {
|
||||||
|
dailyPlanService.startStocking(reqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/cancelStocking")
|
||||||
|
@Operation(summary = "取消备货")
|
||||||
|
@PreAuthorize("@ss.hasPermission('lms:daily-plan:operate')")
|
||||||
|
public CommonResult<Boolean> cancelStocking(@Valid @RequestBody DailyPlanReasonReqVO reqVO) {
|
||||||
|
dailyPlanService.cancelStocking(reqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/restoreStocking")
|
||||||
|
@Operation(summary = "恢复备货")
|
||||||
|
@PreAuthorize("@ss.hasPermission('lms:daily-plan:operate')")
|
||||||
|
public CommonResult<Boolean> restoreStocking(@Valid @RequestBody DailyPlanReasonReqVO reqVO) {
|
||||||
|
dailyPlanService.restoreStocking(reqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/startSleeving")
|
||||||
|
@Operation(summary = "开始套管")
|
||||||
|
@PreAuthorize("@ss.hasPermission('lms:daily-plan:operate')")
|
||||||
|
public CommonResult<Boolean> startSleeving(@Valid @RequestBody DailyPlanVersionReqVO reqVO) {
|
||||||
|
dailyPlanService.startSleeving(reqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/cancelSleeving")
|
||||||
|
@Operation(summary = "取消套管")
|
||||||
|
@PreAuthorize("@ss.hasPermission('lms:daily-plan:operate')")
|
||||||
|
public CommonResult<Boolean> cancelSleeving(@Valid @RequestBody DailyPlanReasonReqVO reqVO) {
|
||||||
|
dailyPlanService.cancelSleeving(reqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/restoreSleeving")
|
||||||
|
@Operation(summary = "恢复套管")
|
||||||
|
@PreAuthorize("@ss.hasPermission('lms:daily-plan:operate')")
|
||||||
|
public CommonResult<Boolean> restoreSleeving(@Valid @RequestBody DailyPlanReasonReqVO reqVO) {
|
||||||
|
dailyPlanService.restoreSleeving(reqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/cancelOrder")
|
||||||
|
@Operation(summary = "取消日计划订单")
|
||||||
|
@PreAuthorize("@ss.hasPermission('lms:daily-plan:operate')")
|
||||||
|
public CommonResult<Boolean> cancelOrder(@Valid @RequestBody DailyPlanReasonReqVO reqVO) {
|
||||||
|
dailyPlanService.cancelOrder(reqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/restoreOrder")
|
||||||
|
@Operation(summary = "恢复日计划订单")
|
||||||
|
@PreAuthorize("@ss.hasPermission('lms:daily-plan:operate')")
|
||||||
|
public CommonResult<Boolean> restoreOrder(@Valid @RequestBody DailyPlanReasonReqVO reqVO) {
|
||||||
|
dailyPlanService.restoreOrder(reqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/finishOrder")
|
||||||
|
@Operation(summary = "结束日计划订单")
|
||||||
|
@PreAuthorize("@ss.hasPermission('lms:daily-plan:operate')")
|
||||||
|
public CommonResult<Boolean> finishOrder(@Valid @RequestBody DailyPlanVersionReqVO reqVO) {
|
||||||
|
dailyPlanService.finishOrder(reqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/updateSort")
|
||||||
|
@Operation(summary = "批量修改日计划排序")
|
||||||
|
@PreAuthorize("@ss.hasPermission('lms:daily-plan:schedule')")
|
||||||
|
public CommonResult<Boolean> updateSort(@Valid @RequestBody DailyPlanSortUpdateReqVO reqVO) {
|
||||||
|
dailyPlanService.updateSort(reqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/updateWeight")
|
||||||
|
@Operation(summary = "修改日计划调度权重")
|
||||||
|
@PreAuthorize("@ss.hasPermission('lms:daily-plan:schedule')")
|
||||||
|
public CommonResult<Boolean> updateWeight(@Valid @RequestBody DailyPlanWeightUpdateReqVO reqVO) {
|
||||||
|
dailyPlanService.updateWeight(reqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/updateStrategy")
|
||||||
|
@Operation(summary = "修改日计划调度策略")
|
||||||
|
@PreAuthorize("@ss.hasPermission('lms:daily-plan:strategy')")
|
||||||
|
public CommonResult<Boolean> updateStrategy(@Valid @RequestBody DailyPlanStrategyUpdateReqVO reqVO) {
|
||||||
|
dailyPlanService.updateStrategy(reqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,233 @@
|
|||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace LmsDailyPlanApi {
|
||||||
|
export interface DailyPlan {
|
||||||
|
appendQty: number;
|
||||||
|
createTime: string;
|
||||||
|
creator: string;
|
||||||
|
dailyPlanId: number;
|
||||||
|
erpOrderCode?: string;
|
||||||
|
manualOrderCode?: string;
|
||||||
|
materialCode: string;
|
||||||
|
materialId: number;
|
||||||
|
materialName: string;
|
||||||
|
materialSpec?: string;
|
||||||
|
orderEndTime?: string;
|
||||||
|
orderStartTime?: string;
|
||||||
|
orderStatus: number;
|
||||||
|
packingInfo?: string;
|
||||||
|
planCode: string;
|
||||||
|
planDate: string;
|
||||||
|
planQty: number;
|
||||||
|
previousOrderStatus?: number;
|
||||||
|
previousSleevingStatus?: number;
|
||||||
|
previousStockingStatus?: number;
|
||||||
|
sleevedQty: number;
|
||||||
|
sleevingCompleteTime?: string;
|
||||||
|
sleevingStartTime?: string;
|
||||||
|
sleevingStatus: number;
|
||||||
|
sortSeq: number;
|
||||||
|
sourceType: number;
|
||||||
|
stockedQty: number;
|
||||||
|
stockingCompleteTime?: string;
|
||||||
|
stockingStartTime?: string;
|
||||||
|
stockingStatus: number;
|
||||||
|
totalQty: number;
|
||||||
|
updateTime?: string;
|
||||||
|
updater?: string;
|
||||||
|
updaterName?: string;
|
||||||
|
version: number;
|
||||||
|
weight: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ManagementPageReq extends PageParam {
|
||||||
|
materialKeyword?: string;
|
||||||
|
orderStatus?: number;
|
||||||
|
planDateEnd?: string;
|
||||||
|
planDateStart?: string;
|
||||||
|
planOrOrderCode?: string;
|
||||||
|
sourceType?: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface WorkPageReq extends PageParam {
|
||||||
|
materialKeyword?: string;
|
||||||
|
orderStatus?: number;
|
||||||
|
planOrOrderCode?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CreateReq {
|
||||||
|
manualOrderCode?: string;
|
||||||
|
materialCode: string;
|
||||||
|
materialId: number;
|
||||||
|
materialName: string;
|
||||||
|
materialSpec?: string;
|
||||||
|
packingInfo?: string;
|
||||||
|
planDate: string;
|
||||||
|
planQty: number;
|
||||||
|
sortSeq: number;
|
||||||
|
weight: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UpdateReq extends CreateReq {
|
||||||
|
dailyPlanId: number;
|
||||||
|
version: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface VersionReq {
|
||||||
|
id: number;
|
||||||
|
version: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface StartReq extends VersionReq {
|
||||||
|
appendQty: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface AppendReq extends VersionReq {
|
||||||
|
appendQty: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ReasonReq extends VersionReq {
|
||||||
|
reason: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SortUpdateReq {
|
||||||
|
items: Array<{
|
||||||
|
id: number;
|
||||||
|
sortSeq: number;
|
||||||
|
version: number;
|
||||||
|
}>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface WeightUpdateReq extends VersionReq {
|
||||||
|
weight: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface StrategyUpdateReq {
|
||||||
|
strategyMode: number;
|
||||||
|
strategyType: number;
|
||||||
|
version: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface OperationLog {
|
||||||
|
afterValue?: string;
|
||||||
|
beforeValue?: string;
|
||||||
|
changeQty?: number;
|
||||||
|
dailyPlanId: number;
|
||||||
|
operationLogId: number;
|
||||||
|
operationReason?: string;
|
||||||
|
operationTarget: string;
|
||||||
|
operationTime: string;
|
||||||
|
operationType: string;
|
||||||
|
operator: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Strategy {
|
||||||
|
cursorDailyPlanId?: number;
|
||||||
|
strategyId: number;
|
||||||
|
strategyMode: number;
|
||||||
|
strategyType: number;
|
||||||
|
updateTime?: string;
|
||||||
|
updater?: string;
|
||||||
|
updaterName?: string;
|
||||||
|
version: number;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getDailyPlanManagementPage(params: LmsDailyPlanApi.ManagementPageReq) {
|
||||||
|
return requestClient.get<PageResult<LmsDailyPlanApi.DailyPlan>>(
|
||||||
|
'/lms/daily-plan/managementPage',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getDailyPlanWorkPage(params: LmsDailyPlanApi.WorkPageReq) {
|
||||||
|
return requestClient.get<PageResult<LmsDailyPlanApi.DailyPlan>>(
|
||||||
|
'/lms/daily-plan/workPage',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getDailyPlan(id: number) {
|
||||||
|
return requestClient.get<LmsDailyPlanApi.DailyPlan>('/lms/daily-plan/get', {
|
||||||
|
params: { id },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getDailyPlanOperationLogList(id: number) {
|
||||||
|
return requestClient.get<LmsDailyPlanApi.OperationLog[]>(
|
||||||
|
'/lms/daily-plan/operationLogList',
|
||||||
|
{ params: { id } },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getDailyPlanStrategies() {
|
||||||
|
return requestClient.get<LmsDailyPlanApi.Strategy[]>(
|
||||||
|
'/lms/daily-plan/getStrategies',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function createDailyPlan(data: LmsDailyPlanApi.CreateReq) {
|
||||||
|
return requestClient.post<number>('/lms/daily-plan/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function updateDailyPlan(data: LmsDailyPlanApi.UpdateReq) {
|
||||||
|
return requestClient.put('/lms/daily-plan/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function startDailyPlanOrder(data: LmsDailyPlanApi.StartReq) {
|
||||||
|
return requestClient.put('/lms/daily-plan/startOrder', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function appendDailyPlanQuantity(data: LmsDailyPlanApi.AppendReq) {
|
||||||
|
return requestClient.put('/lms/daily-plan/appendQuantity', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function startDailyPlanStocking(data: LmsDailyPlanApi.VersionReq) {
|
||||||
|
return requestClient.put('/lms/daily-plan/startStocking', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function cancelDailyPlanStocking(data: LmsDailyPlanApi.ReasonReq) {
|
||||||
|
return requestClient.put('/lms/daily-plan/cancelStocking', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function restoreDailyPlanStocking(data: LmsDailyPlanApi.ReasonReq) {
|
||||||
|
return requestClient.put('/lms/daily-plan/restoreStocking', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function startDailyPlanSleeving(data: LmsDailyPlanApi.VersionReq) {
|
||||||
|
return requestClient.put('/lms/daily-plan/startSleeving', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function cancelDailyPlanSleeving(data: LmsDailyPlanApi.ReasonReq) {
|
||||||
|
return requestClient.put('/lms/daily-plan/cancelSleeving', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function restoreDailyPlanSleeving(data: LmsDailyPlanApi.ReasonReq) {
|
||||||
|
return requestClient.put('/lms/daily-plan/restoreSleeving', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function cancelDailyPlanOrder(data: LmsDailyPlanApi.ReasonReq) {
|
||||||
|
return requestClient.put('/lms/daily-plan/cancelOrder', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function restoreDailyPlanOrder(data: LmsDailyPlanApi.ReasonReq) {
|
||||||
|
return requestClient.put('/lms/daily-plan/restoreOrder', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function finishDailyPlanOrder(data: LmsDailyPlanApi.VersionReq) {
|
||||||
|
return requestClient.put('/lms/daily-plan/finishOrder', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function updateDailyPlanSort(data: LmsDailyPlanApi.SortUpdateReq) {
|
||||||
|
return requestClient.put('/lms/daily-plan/updateSort', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function updateDailyPlanWeight(data: LmsDailyPlanApi.WeightUpdateReq) {
|
||||||
|
return requestClient.put('/lms/daily-plan/updateWeight', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function updateDailyPlanStrategy(data: LmsDailyPlanApi.StrategyUpdateReq) {
|
||||||
|
return requestClient.put('/lms/daily-plan/updateStrategy', data);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user