“djh”
3 days ago aad364bb323a1eaa0389ee5c6389bdc0ea7ed526
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
package com.gkhy.hazmat.admin.controller.web;
 
 
import com.gkhy.hazmat.common.annotation.RepeatSubmit;
import com.gkhy.hazmat.common.api.CommonResult;
import com.gkhy.hazmat.system.domain.HzEntryRecord;
import com.gkhy.hazmat.system.domain.HzHazmat;
import com.gkhy.hazmat.system.service.HzEntryRecordService;
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.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
 
/**
 * <p>
 * 入库记录表 前端控制器
 * </p>
 *
 * @author kzy
 * @since 2024-08-06 10:33:05
 */
@Api(tags = "原材料入库前端控制器")
@RestController
@RequestMapping("/entry-record")
public class HzEntryRecordController {
 
    @Autowired
    private HzEntryRecordService entryRecordService;
 
    @ApiOperation(value = "入库记录列表(分页)")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "pageNum", dataType = "int", required = false, value = "当前页,默认1"),
            @ApiImplicitParam(paramType = "query", name = "pageSize", dataType = "int", required = false, value = "每页数目,默认10")
    })
    @GetMapping("/list")
    public CommonResult list(HzEntryRecord entryRecord){
        return CommonResult.success(entryRecordService.selectEntryRecordList(entryRecord));
    }
 
    @ApiOperation(value = "根据入库id分页查询详情列表")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "pageNum", dataType = "int", required = false, value = "当前页,默认1"),
            @ApiImplicitParam(paramType = "query", name = "pageSize", dataType = "int", required = false, value = "每页数目,默认10"),
            @ApiImplicitParam(paramType = "query", name = "entryId", dataType = "long", required = true, value = "入库id")
    })
    @GetMapping("/hazmatlist")
    public CommonResult hazmatlist(Long entryId){
        return CommonResult.success(entryRecordService.selectHazmatListByEntryId(entryId));
    }
 
    @PreAuthorize("hasAnyAuthority('hazmat:manage:company','hazmat:manage:common')")
    @RepeatSubmit
    @ApiOperation(value = "新增入库记录")
    @PostMapping
    public CommonResult add(@Validated @RequestBody HzEntryRecord entryRecord){
        return CommonResult.success(entryRecordService.insertEntryRecord(entryRecord));
    }
 
    @PreAuthorize("hasAnyAuthority('hazmat:manage:company','hazmat:manage:common')")
    @RepeatSubmit
    @ApiOperation(value = "编辑入库记录")
    @PutMapping
    public CommonResult edit(@Validated @RequestBody HzEntryRecord entryRecord){
        return CommonResult.success(entryRecordService.updateEntryRecord(entryRecord));
    }
 
 
    @PreAuthorize("hasAnyAuthority('hazmat:manage:company','hazmat:manage:common')")
    @RepeatSubmit
    @ApiOperation(value = "入库")
    @PostMapping("/doEntry/{entryRecordId}")
    public CommonResult doEntry(@PathVariable(value = "entryRecordId", required = true) Long entryRecordId){
        entryRecordService.doEntry(entryRecordId);
        return CommonResult.success();
    }
 
    @PreAuthorize("hasAnyAuthority('hazmat:manage:company','hazmat:manage:common')")
    @RepeatSubmit
    @ApiOperation(value = "删除入库记录")
    @DeleteMapping(value = { "/{entryRecordId}" })
    public CommonResult delete(@PathVariable(value = "entryRecordId", required = true) Long entryRecordId){
        return CommonResult.success(entryRecordService.deleteEntryRecordById(entryRecordId));
    }
 
 
    @PreAuthorize("hasAnyAuthority('hazmat:manage:company','hazmat:manage:common')")
    @RepeatSubmit
    @ApiOperation(value = "新增订单入库记录")
    @PostMapping("/orderadd")
    public CommonResult orderadd(@Validated @RequestBody HzEntryRecord entryRecord){
        return CommonResult.success(entryRecordService.insertOrderEntryRecord(entryRecord));
    }
 
    @PreAuthorize("hasAnyAuthority('hazmat:manage:company','hazmat:manage:common')")
    @RepeatSubmit
    @ApiOperation(value = "编辑订单入库记录")
    @PutMapping("/orderedit")
    public CommonResult orderedit(@Validated @RequestBody HzEntryRecord entryRecord){
        return CommonResult.success(entryRecordService.updateOrderEntryRecord(entryRecord));
    }
 
    @PreAuthorize("hasAnyAuthority('hazmat:manage:company','hazmat:manage:common')")
    @RepeatSubmit
    @ApiOperation(value = "删除订单入库记录")
    @DeleteMapping(value = { "order/{entryRecordId}" })
    public CommonResult orderdelete(@PathVariable(value = "entryRecordId", required = true) Long entryRecordId){
        return CommonResult.success(entryRecordService.deleteOrderEntryRecordById(entryRecordId));
    }
 
 
    @PreAuthorize("hasAnyAuthority('hazmat:manage:company','hazmat:manage:common')")
    @RepeatSubmit
    @ApiOperation(value = "订单入库")
    @PostMapping("/orderEntry/{entryRecordId}")
    public CommonResult orderEntry(@PathVariable(value = "entryRecordId", required = true) Long entryRecordId){
        entryRecordService.orderEntry(entryRecordId);
        return CommonResult.success();
    }
 
 
    @ApiOperation(value = "订单入库记录列表(分页)")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "pageNum", dataType = "int", required = false, value = "当前页,默认1"),
            @ApiImplicitParam(paramType = "query", name = "pageSize", dataType = "int", required = false, value = "每页数目,默认10")
    })
    @GetMapping("/orderlist")
    public CommonResult orderlist(HzEntryRecord entryRecord){
        return CommonResult.success(entryRecordService.selectOrderEntryRecordList(entryRecord));
    }
 
    @ApiOperation(value = "根据订单入库id分页查询详情列表")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "pageNum", dataType = "int", required = false, value = "当前页,默认1"),
            @ApiImplicitParam(paramType = "query", name = "pageSize", dataType = "int", required = false, value = "每页数目,默认10"),
    })
    @GetMapping("order/hazmatlist")
    public CommonResult orderhazmatlist(HzHazmat hzHazmat){
        return CommonResult.success(entryRecordService.selectOrderHazmatListByEntryId(hzHazmat));
    }
 
 
 
}