XiaoRuby
2023-09-01 0a44f2ea664d893503246a232646f2593a738460
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
package com.yuanchu.mom.controller;
 
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;
 
@Api(tags = "生产管理-->生产计划")
@RestController
@RequestMapping("/productionPlan")
public class ProductionPlanController {
 
    @Autowired
    private ManualTechnologyService manualTechnologyService;
 
    @Autowired
    private ManufactureOrderService manufactureOrderService;
 
    @Autowired
    private ManufactureSchedulingService manufactureSchedulingService;
 
    @Autowired
    private ManufactureOrderProcessService manufactureOrderProcessService;
 
    @ApiOperation(value = "二级树")
    @GetMapping("/tow_tree")
    public Result<?> towTree() {
        return Result.success(manufactureOrderService.towTree());
    }
 
    @ApiOperation(value = "查看排产详情")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "schedulingId", value = "排产id", dataTypeClass = Integer.class, required = true)
    })
    @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")
    })
    @GetMapping("/update_time")
    public Result<?> updateTime(Integer technologyId, Integer schedulingId, String startTime) {
        Integer isUpdateSuccess = manufactureOrderProcessService.updateTime(technologyId, schedulingId, startTime);
        if (isUpdateSuccess >= 1) {
            return Result.success("更新成功!");
        }
        return Result.fail("更新失败!");
    }
}