zss
2023-09-21 2dbc49184bd74845c8da694c20d6fd03d7ac87e0
production-server/src/main/java/com/yuanchu/mom/controller/ProductionPlanController.java
@@ -1,42 +1,73 @@
package com.yuanchu.mom.controller;
import com.yuanchu.mom.service.ProductionPlanService;
import com.yuanchu.mom.service.ManualTechnologyService;
import com.yuanchu.mom.service.ManufactureOrderProcessService;
import com.yuanchu.mom.service.ManufactureOrderService;
import com.yuanchu.mom.service.ManufactureSchedulingService;
import com.yuanchu.mom.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
@Api(tags = "生产管理-->生产计划")
@RestController
@RequestMapping("/productionPlan")
public class ProductionPlanController {
    @Resource
    ProductionPlanService productionPlanService;
    @Autowired
    private ManualTechnologyService manualTechnologyService;
    @Autowired
    private ManufactureOrderService manufactureOrderService;
    @ApiOperation(value = "查询设备列表")
    @GetMapping("/selectAllDev")
    public Result selectAllDev() {
        return Result.success(productionPlanService.selectAllDev());
    @Autowired
    private ManufactureSchedulingService manufactureSchedulingService;
    @Autowired
    private ManufactureOrderProcessService manufactureOrderProcessService;
    @ApiOperation(value = "二级树")
    @GetMapping("/tow_tree")
    public Result<?> towTree() {
        return Result.success(manufactureOrderService.towTree());
    }
    @ApiOperation(value = "查询生产计划列表")
    @ApiOperation(value = "查看排产详情")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "deviceId", value = "设备id", dataTypeClass = Integer.class, required = true),
            @ApiImplicitParam(name = "orderCode", value = "订单号", dataTypeClass = String.class),
            @ApiImplicitParam(name = "name", value = "产品名称", dataTypeClass = String.class),
            @ApiImplicitParam(name = "startTime", value = "计划开始日期", dataTypeClass = String.class),
            @ApiImplicitParam(name = "endTime", value = "计划结束日期", dataTypeClass = String.class)
            @ApiImplicitParam(name = "schedulingId", value = "排产id", dataTypeClass = Integer.class, required = true)
    })
    @GetMapping("/selectAllPlan")
    public Result selectAllPlan(Integer deviceId, String orderCode, String name, String startTime, String endTime) {
        return Result.success(productionPlanService.selectAllPlan(deviceId,orderCode,name,startTime,endTime));
    @GetMapping("/sePros")
    public Result<?> sePros(Integer schedulingId) {
        return Result.success(manufactureOrderService.sePros(schedulingId));
    }
    @ApiOperation(value = "根据生产订单查看生产计划")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "manOrdId", value = "生产订单id", dataTypeClass = Integer.class, required = true),
            @ApiImplicitParam(name = "productName", value = "产品名称", dataTypeClass = String.class),
            @ApiImplicitParam(name = "startTime", value = "开始日期", dataTypeClass = String.class),
            @ApiImplicitParam(name = "endTime", value = "结束日期", dataTypeClass = String.class)
    })
    @GetMapping("/produceTable")
    public Result<?> selectProduceTable(Integer manOrdId, String productName, String startTime, String endTime) {
        return Result.success(manufactureSchedulingService.selectProduceTable(manOrdId, productName, startTime, endTime));
    }
    @ApiOperation(value = "查看排产详情-->切换修改时间与周期")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "technologyId", value = "工序Id", dataTypeClass = Integer.class, required = true),
            @ApiImplicitParam(name = "schedulingId", value = "排产Id", dataTypeClass = Integer.class, required = true),
            @ApiImplicitParam(name = "startTime", value = "开始时间", dataTypeClass = String.class, required = true, dataType = "date"),
            @ApiImplicitParam(name = "period", value = "周期", dataTypeClass = Integer.class, required = true)
    })
    @GetMapping("/update_time")
    public Result<?> updateTime(Integer technologyId, Integer schedulingId, String startTime, Integer period) {
        manufactureOrderProcessService.updateTime(technologyId, schedulingId, startTime, period);
        return Result.success("更新成功!");
    }
}