廖井涛
2024-05-31 fda672b4fd0ef3bd4f0759e5c58fdca8f243e550
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
package com.example.erp.controller.pp;
 
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.example.erp.common.Constants;
import com.example.erp.entity.pp.FlowCard;
import com.example.erp.entity.sd.DeliveryDetail;
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 io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import java.sql.Date;
import java.util.Map;
 
@RestController
@Api(value="流程卡controller",tags={"流程卡操作接口"})
@RequestMapping("/processCard")
public class ProcessCardController {
    @Autowired
    FlowCardService flowCardService;
 
    //流程卡管理查询
    @ApiOperation("流程卡管理查询接口")
    @SaCheckPermission("SelectProcessCard.search")
    @PostMapping  ("/flowCard/{pageNum}/{pageSize}/{selectTime1}/{selectTime2}")
    public Result dateProcess(
            @PathVariable Integer pageNum,
            @PathVariable Integer pageSize,
            @PathVariable Date selectTime1,
            @PathVariable Date selectTime2,
            @RequestBody FlowCard  flowCard){
        return Result.seccess(flowCardService.selectProcessCard(pageNum,pageSize,selectTime1,selectTime2,flowCard));
        
    }
 
    //分架查询
    @ApiOperation("分架查询接口")
    @SaCheckPermission("SelectAddProcess.search")
    @PostMapping  ("/selectAddProcess/{selectTime1}/{selectTime2}")
    public Result selectAddProcess(
            @PathVariable Date selectTime1,
            @PathVariable Date selectTime2,
            @RequestBody FlowCard  flowCard){
        return Result.seccess(flowCardService.selectAddProcess(selectTime1,selectTime2,flowCard));
    }
 
    //分架明细查询
    @ApiOperation("分架明细查询接口")
    @SaCheckPermission("SplittingDetails.search")
    @PostMapping  ("/detailsSelect/{orderId}")
    public Result detailsSelect(
            @PathVariable String orderId,
            @RequestBody FlowCard flowCard){
        return Result.seccess(flowCardService.detailsSelectSv(orderId,flowCard));
 
    }
 
 
    //删除流程卡
    @ApiOperation("删除流程卡接口")
    @SaCheckPermission("SelectProcessCard.delete")
    @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,"删除失败,请检查是否已报工");
//
//        }
        return  Result.seccess(flowCardService.deleteFlowCardSv(orderId,processId));
    }
 
    //修改排版状态
    @ApiOperation("修改排版状态接口")
    @SaCheckPermission("SelectProcessCard.review")
    @PostMapping("/updateLayoutStatus/{processId}/{state}")
    public Result updateLayoutStatus(
            @PathVariable String processId,
            @PathVariable Integer state
    ){
        if(flowCardService.updateLayoutStatusSv(processId,state)){
            return Result.seccess();
        }else {
            throw new ServiceException(Constants.Code_500,"修改失败");
 
        }
    }
 
    //分架新增明细查询
    @ApiOperation("分架明细新增接口")
    @PostMapping  ("/selectNoCard/{orderId}/{productionId}")
    public Result SelectNoCard(
            @PathVariable String orderId,
            @PathVariable String productionId,
            @RequestBody FlowCard flowCard){
        return Result.seccess(flowCardService.selectNoCardSv(orderId,productionId,flowCard));
 
    }
 
    //添加流程卡
    @ApiOperation("流程卡创建接口")
    @SaCheckPermission("AddProcessCard.add")
    @PostMapping("/addFlowCard")
    public Result AddOrderWork( @RequestBody Map<String,Object> object){
        if(flowCardService.addFlowCardSv(object)){
            return Result.seccess();
        }else {
            throw new ServiceException(Constants.Code_500,"保存失败");
 
        }
    }
 
    //查询第一次排产数据
    @ApiOperation("排产界面加载查询接口")
    @PostMapping  ("/selectLastScheduling/{selectTime1}/{selectTime2}")
    public Result selectLastScheduling(
            @PathVariable String selectTime1,
            @PathVariable String selectTime2,
            @RequestBody FlowCard flowCard){
        return Result.seccess(flowCardService.selectLastScheduling(selectTime1,selectTime2,flowCard));
 
    }
    //查询排产数据
    @ApiOperation("排产点击按钮查询接口")
    @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 FlowCard flowCard){
        return Result.seccess(flowCardService.selectSchedulingSv(selectTime1,selectTime2,orderId,processes,state,flowCard));
 
    }
    //流程卡明细查询
    @ApiOperation("流程卡明细查询接口")
    @SaCheckPermission("SelectDetailProcessCard.search")
    @PostMapping  ("/flowCardDetail/{processId}")
    public Result flowCardDetail(
            @PathVariable String processId,
            @RequestBody FlowCard flowCard){
        return Result.seccess(flowCardService.flowCardDetailSv(processId,flowCard));
 
    }
 
    @ApiOperation("流程卡打印查询接口")
    @SaCheckPermission("SelectPrintFlowCard.search")
    @PostMapping  ("/selectPrintFlowCard/{selectTime1}/{selectTime2}/{orderId}/{project}")
    public Result selectPrintFlowCard(
            @PathVariable Date selectTime1,
            @PathVariable Date selectTime2,
            @PathVariable String orderId,
            @PathVariable String project,
            @RequestBody FlowCard flowCard){
        return Result.seccess(flowCardService.selectPrintFlowCardSv(selectTime1,selectTime2,orderId,project,flowCard));
    }
 
    @ApiOperation("流程卡明细查询接口")
    @SaCheckPermission("PrintFlowCard.search")
    @PostMapping  ("/selectPrint/{orderId}")
    public Result selectPrint(
            @PathVariable String orderId,
            @RequestBody FlowCard flowCard){
        return Result.seccess(flowCardService.selectPrintSv(orderId,flowCard));
 
    }
 
    @ApiOperation("打印流程卡数据查询接口")
    @PostMapping("/getSelectPrinting")
    public Result getSelectPrinting( @RequestBody Map<String,Object> object){
        return Result.seccess(flowCardService.getSelectPrintingSv(object));
    }
 
    @ApiOperation("打印标签数据查询接口")
    @PostMapping("/getSelectPrintLabel")
    public Result getSelectPrintLabel( @RequestBody Map<String,Object> object){
        return Result.seccess(flowCardService.getSelectPrintLabelSv(object));
    }
 
    @ApiOperation("复选框修改排版状态")
    @SaCheckPermission("SelectProcessCard.review")
    @PostMapping("/updateComposing")
    public Result updateComposing(
            @RequestBody Map<String,Object>  object
    ){
 
        return  Result.seccess(flowCardService.updateComposingSv(object));
    }
}