chenlu
2024-06-07 2f640b1038fa331954f78ed1f4317212cf5bb34d
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
package com.example.erp.controller.mm;
 
 
 
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.example.erp.common.Constants;
import com.example.erp.common.Result;
import com.example.erp.dto.mm.FinishedOperateLogDTO;
import com.example.erp.entity.mm.FinishedOperateLog;
import com.example.erp.entity.pp.FlowCard;
import com.example.erp.entity.sd.Order;
import com.example.erp.entity.sd.OrderDetail;
import com.example.erp.exception.ServiceException;
import com.example.erp.service.mm.FinishedGoodsInventoryService;
import com.example.erp.tools.DownExcel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.example.erp.entity.mm.FinishedGoodsInventory;
 
 
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.time.LocalDate;
import java.util.List;
import java.util.Map;
 
@RestController
@RequestMapping("/FinishedGoodsInventory")
@Api(value="成品库存controller",tags={"成品库存操作接口"})
public class FinishedGoodsInventoryController {
    @Autowired
    FinishedGoodsInventoryService finishedGoodsInventoryService;
 
    /*成品库存查询*/
    @ApiOperation("成品库存查询接口")
    @SaCheckPermission("ProductStockList.search")
    @PostMapping("/getSelect/{pageNum}/{pageSize}")
    public Result defaultDateFinishedGoodsInventory(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @RequestBody FinishedGoodsInventory finishedGoodsInventory){
        return Result.seccess(finishedGoodsInventoryService.defaultDateFinishedGoodsInventory(pageNum,pageSize,finishedGoodsInventory));
    }
 
    /*查询可入库的成品数据*/
    @ApiOperation("可入库的成品查询接口")
    @SaCheckPermission("CreateProductStock.search")
    @PostMapping("/getSelectWarehousing/{pageNum}/{pageSize}")
    public Result getSelectWarehousing(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @RequestBody FlowCard flowCard){
        return Result.seccess(finishedGoodsInventoryService.getSelectWarehousing(pageNum,pageSize,flowCard));
    }
 
    /*成品入库*/
    @ApiOperation("成品入库接口")
    @SaCheckPermission("CreateProductStock.add")
    @PostMapping("/addSelectWarehousing")
    public Result addSelectWarehousing( @RequestBody Map<String,Object>  object){
        return Result.seccess(finishedGoodsInventoryService.addSelectWarehousing(object));
 
    }
 
    /*查询可发货的成品数据*/
    @ApiOperation("可发货的成品查询接口")
    @SaCheckPermission("FinishedProductOut.search")
    @PostMapping("/getSelectDeliveryDetail/{pageNum}/{pageSize}")
    public Result getSelectDeliveryDetail(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @RequestBody OrderDetail orderDetail){
        return Result.seccess(finishedGoodsInventoryService.getSelectDeliveryDetail(pageNum,pageSize,orderDetail));
    }
 
    /*成品发货*/
    @ApiOperation("成品发货接口")
    @SaCheckPermission("FinishedProductOut.add")
    @PostMapping("/addDeliveryDetail")
    public Result addDeliveryDetail( @RequestBody Map<String,Object>  object){
        return Result.seccess(finishedGoodsInventoryService.addDeliveryDetail(object));
    }
 
    /* 调拨查询*/
    @ApiOperation("可调拨数据查询接口")
    @SaCheckPermission("OrderAllocation.search")
    @PostMapping("/getSelectAllocate/{pageNum}/{pageSize}")
    public Result getSelectAllocate(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @RequestBody OrderDetail orderDetail){
        return Result.seccess(finishedGoodsInventoryService.getSelectAllocate(pageNum,pageSize,orderDetail));
    }
 
    /*订单调拨*/
    @ApiOperation("订单调拨接口")
    @SaCheckPermission("OrderAllocation.add")
    @PostMapping("/updateFinishedGoodsInventoryAllocate")
    public Result updateFinishedGoodsInventoryAllocate( @RequestBody Map<String,Object>  object){
        return Result.seccess(finishedGoodsInventoryService.updateFinishedGoodsInventoryAllocate(object));
    }
 
    /*调拨记录查询*/
    @ApiOperation("调拨记录查询接口")
    @SaCheckPermission("TransferRecord.search")
    @PostMapping("/getSelectAllocateFinishedOperateLog/{pageNum}/{pageSize}/{selectDate}")
    public Result getSelectAllocateFinishedOperateLog(@PathVariable Integer pageNum, @PathVariable Integer pageSize,@PathVariable List<String> selectDate, @RequestBody FinishedOperateLog finishedOperateLog){
        return Result.seccess(finishedGoodsInventoryService.getSelectAllocateFinishedOperateLog(pageNum,pageSize,selectDate,finishedOperateLog));
    }
 
    /*订单领出*/
    @ApiOperation("订单领出接口")
    @SaCheckPermission("FinishedGoodsIssue.add")
    @PostMapping("/updateFinishedGoodsInventoryTakeOut")
    public Result updateFinishedGoodsInventoryTakeOut( @RequestBody Map<String,Object>  object){
        return Result.seccess(finishedGoodsInventoryService.updateFinishedGoodsInventoryTakeOut(object));
    }
 
    /*领出记录查询*/
    @ApiOperation("领出记录查询接口")
    @SaCheckPermission("TakeOutRecord.search")
    @PostMapping("/getSelectOperateRecord/{pageNum}/{pageSize}/{selectDate}")
    public Result getSelectOperateRecord(@PathVariable Integer pageNum, @PathVariable Integer pageSize,@PathVariable List<String> selectDate, @RequestBody FinishedOperateLog finishedOperateLog){
        return Result.seccess(finishedGoodsInventoryService.getSelectOperateRecord(pageNum,pageSize,selectDate,finishedOperateLog));
    }
 
    /*订单返工*/
    @ApiOperation("订单返工查询接口")
    @PostMapping("/updateFinishedGoodsInventoryRework")
    public Result updateFinishedGoodsInventoryRework( @RequestBody Map<String,Object>  object){
        return Result.seccess(finishedGoodsInventoryService.updateFinishedGoodsInventoryRework(object));
    }
 
 
 
    /*订单审核*/
    @ApiOperation("订单审核接口")
    @SaCheckPermission("TakeOutRecord.review")
    @PostMapping("/updateFinishedGoodsInventoryToExamine")
    public Result updateFinishedGoodsInventoryToExamine( @RequestBody Map<String,Object>  object){
        return Result.seccess(finishedGoodsInventoryService.updateFinishedGoodsInventoryToExamine(object,"审核"));
    }
    /*订单反审*/
    @ApiOperation("订单反审接口")
    @SaCheckPermission("TakeOutRecord.review")
    @PostMapping("/updateFinishedGoodsInventoryCounterExamination")
    public Result updateFinishedGoodsInventoryCounterExamination( @RequestBody Map<String,Object>  object){
        return Result.seccess(finishedGoodsInventoryService.updateFinishedGoodsInventoryToExamine(object,"反审"));
    }
 
    /*订单作废*/
    @ApiOperation("订单作废接口")
    @SaCheckPermission("TakeOutRecord.update")
    @PostMapping("/cancelFinishedGoodsInventoryToExamine")
    public Result cancelFinishedGoodsInventoryToExamine( @RequestBody Map<String,Object>  object){
        return Result.seccess(finishedGoodsInventoryService.cancelFinishedGoodsInventoryToExamine(object));
    }
 
    /*出入库记录查询*/
    @ApiOperation("出入库记录查询接口")
    @SaCheckPermission("storageRecord.search")
    @PostMapping("/getSelectStorageRecord/{pageNum}/{pageSize}/{selectDate}/{type}")
    public Result getSelectStorageRecord(@PathVariable Integer pageNum, @PathVariable Integer pageSize,@PathVariable List<String> selectDate,@PathVariable String type, @RequestBody FinishedOperateLog finishedOperateLog){
        return Result.seccess(finishedGoodsInventoryService.getSelectStorageRecord(pageNum,pageSize,selectDate,type,finishedOperateLog));
    }
 
    /*出入库返回*/
    @ApiOperation("出入库返回接口")
    @SaCheckPermission("storageRecord.update")
    @PostMapping("/cancelFinishedGoodsInventoryStorage")
    public Result cancelFinishedGoodsInventoryStorage( @RequestBody Map<String,Object>  object){
        return Result.seccess(finishedGoodsInventoryService.cancelFinishedGoodsInventoryStorage(object));
    }
 
    @ApiOperation("成品库存记录查询接口")
    @SaCheckPermission("WarehouseReport.search")
    @PostMapping("/getSelectFinishedOperateLogReport/{pageNum}/{pageSize}/{selectDate}")
    public Result getSelectFinishedOperateLogReport(@PathVariable Integer pageNum, @PathVariable Integer pageSize,@PathVariable List<String> selectDate, @RequestBody FinishedOperateLog finishedOperateLog){
        return Result.seccess(finishedGoodsInventoryService.getSelectFinishedOperateLogReport(pageNum,pageSize,selectDate,finishedOperateLog));
    }
 
    @ApiOperation("成品报表导出")
    @PostMapping("/exportFinishedOperateLogReport")
    public void exportFinishedOperateLogReport(HttpServletResponse response, @RequestBody List<LocalDate> dates) throws IOException, IllegalAccessException, InstantiationException {
        //参数:相应的数据,实体类信息,相应的方法(数据获取),生成的excel名字
        DownExcel.download(response, FinishedOperateLogDTO.class, finishedGoodsInventoryService.exportFinishedOperateLogReport(dates),"orderReport");
    }
}