chenlu
2024-02-23 92f00c92b4e6c1c61ce8461d9b72fd2969e66802
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
package com.example.erp.controller.pp;
 
import com.example.erp.common.Constants;
import com.example.erp.entity.pp.FlowCard;
import com.example.erp.entity.sd.Order;
import com.example.erp.common.Result;
import com.example.erp.entity.sd.OrderDetail;
import com.example.erp.entity.sd.OrderGlassDetail;
import com.example.erp.exception.ServiceException;
import com.example.erp.service.pp.FlowCardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import java.sql.Date;
import java.util.Map;
 
@RestController
@RequestMapping("/processCard")
public class ProcessCardController {
    @Autowired
    FlowCardService flowCardService;
 
    //流程卡管理查询
    @PostMapping  ("/flowCard/{selectTime1}/{selectTime2}")
    public Result DateProcess(
            @PathVariable Date selectTime1,
            @PathVariable Date selectTime2,
            @RequestBody FlowCard  flowCard){
        return Result.seccess(flowCardService.selectProcessCard(selectTime1,selectTime2,flowCard));
        
    }
 
    //分架查询
    @PostMapping  ("/selectAddProcess/{selectTime1}/{selectTime2}")
    public Result SelectAddProcess(
            @PathVariable Date selectTime1,
            @PathVariable Date selectTime2,
            @RequestBody FlowCard  flowCard){
    //    System.out.println(selectTime1+" "+selectTime2+" "+flowCard.toString());
        return Result.seccess(flowCardService.selectAddProcess(selectTime1,selectTime2,flowCard));
 
    }
 
    //分架明细查询
    @PostMapping  ("/detailsSelect/{orderId}")
 
    public Result DetailsSelect(
            @PathVariable String orderId,
            @RequestBody FlowCard flowCard){
        return Result.seccess(flowCardService.DetailsSelectSv(orderId,flowCard));
 
    }
 
 
    //删除工单
    @PostMapping("/deleteFlowCard/{orderId}/{processId}")
    public Result deleteOrderWork(
            @PathVariable String orderId,
            @PathVariable String processId
    ){
        if(flowCardService.DeleteFlowCardSv(orderId,processId)){
            return Result.seccess();
        }else {
            throw new ServiceException(Constants.Code_500,"删除失败");
 
        }
    }
 
    //修改排版状态
    @PostMapping("/updateLayoutStatus/{processId}")
    public Result updateLayoutStatus(
            @PathVariable String processId
    ){
        System.out.println(flowCardService.UpdateLayoutStatusSv(processId));
        if(flowCardService.UpdateLayoutStatusSv(processId)){
            return Result.seccess();
        }else {
            throw new ServiceException(Constants.Code_500,"修改失败");
 
        }
    }
 
    //分架新增明细查询
    @PostMapping  ("/selectNoCard/{orderId}/{productionId}")
 
    public Result SelectNoCard(
            @PathVariable String orderId,
            @PathVariable String productionId,
            @RequestBody FlowCard flowCard){
        return Result.seccess(flowCardService.SelectNoCardSv(orderId,productionId,flowCard));
 
    }
 
    //添加流程卡
    @PostMapping("/addFlowCard")
    public Result AddOrderWork( @RequestBody Map<String,Object> object){
        System.out.println("obj:"+object);
        if(flowCardService.AddFlowCardSv(object)){
            return Result.seccess();
        }else {
            throw new ServiceException(Constants.Code_500,"保存失败");
 
        }
    }
 
}