guoyuji
2024-03-07 fcf705e1f9a369cab61e60d72048c36a0e1ee793
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
78
79
80
81
82
83
84
85
86
87
88
89
90
package com.example.erp.controller.pp;
 
import com.example.erp.common.Constants;
import com.example.erp.common.Result;
import com.example.erp.entity.pp.ProductionScheduling;
import com.example.erp.exception.ServiceException;
import com.example.erp.service.pp.ProductionSchedulingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import java.sql.Date;
import java.util.Map;
 
@RestController
@RequestMapping("/productionScheduling")
public class ProductionSchedulingController {
    @Autowired
    ProductionSchedulingService productionSchedulingService;
 
    //查询第一次排版数据
    @PostMapping  ("/selectLastScheduling/{selectTime1}/{selectTime2}")
    public Result selectLastScheduling(
            @PathVariable String selectTime1,
            @PathVariable String selectTime2,
            @RequestBody ProductionScheduling productionScheduling){
        return Result.seccess(productionSchedulingService.selectLastScheduling(selectTime1,selectTime2,productionScheduling));
 
    }
    //点击查询排版数据
    @PostMapping  ("/selectScheduling/{selectTime1}/{selectTime2}/{orderId}/{processes}/{state}")
    public Result SelectScheduling(
            @PathVariable String selectTime1,
            @PathVariable String selectTime2,
            @PathVariable String orderId,
            @PathVariable String processes,
            @PathVariable Integer state,
            @RequestBody ProductionScheduling productionScheduling){
        return Result.seccess(productionSchedulingService.SelectSchedulingSv(selectTime1,selectTime2,orderId,processes,state,productionScheduling));
 
    }
 
    //点击查询排版数据(带订单号查询)
    @PostMapping  ("/selectSchedulingNot/{selectTime1}/{selectTime2}/{orderId}/{processes}/{state}")
    public Result selectSchedulingNot(
            @PathVariable String selectTime1,
            @PathVariable String selectTime2,
            @PathVariable String orderId,
            @PathVariable String processes,
            @PathVariable Integer state,
            @RequestBody ProductionScheduling productionScheduling){
        return Result.seccess(productionSchedulingService.selectSchedulingNotSv(selectTime1,selectTime2,orderId,processes,state,productionScheduling));
 
    }
 
    //添加排产数据
    @PostMapping("/addScheduling")
    public Result AddScheduling( @RequestBody Map<String,Object>  object){
 
        if(productionSchedulingService.AddSchedulingSv(object)){
            return Result.seccess();
        }else {
            throw new ServiceException(Constants.Code_500,"保存失败");
 
        }
    }
 
    //删除排产数据
    @PostMapping("/deleteScheduling")
    public Result deleteScheduling( @RequestBody Map<String,Object>  object) throws Exception{
 
        if(productionSchedulingService.deleteSchedulingSv(object)){
            return Result.seccess();
        }else {
            throw new ServiceException(Constants.Code_500,"删除失败");
 
        }
    }
 
    @PostMapping("/examineScheduling")
    public Result ExamineScheduling( @RequestBody Map<String,Object>  object){
 
        if(productionSchedulingService.ExamineSchedulingSv(object)){
            return Result.seccess();
        }else {
            throw new ServiceException(Constants.Code_500,"审核失败");
 
        }
    }
 
}