|
@@ -0,0 +1,93 @@
|
|
1
|
+package com.oqpo.api.web.controller.pomng;
|
|
2
|
+
|
|
3
|
+import com.oqpo.api.enums.DataMessageCode;
|
|
4
|
+import com.oqpo.api.enums.SystemMessageCode;
|
|
5
|
+import com.oqpo.api.service.oper.AfflService;
|
|
6
|
+import com.oqpo.api.service.pomng.PchReqService;
|
|
7
|
+import com.oqpo.api.web.dto.request.oper.affl.AfflGridRequest;
|
|
8
|
+import com.oqpo.api.web.dto.request.oper.affl.AfflShopBaseInfoGridRequest;
|
|
9
|
+import com.oqpo.api.web.dto.request.oper.affl.SaveAfflRequest;
|
|
10
|
+import com.oqpo.api.web.dto.request.pomng.pchReq.PchReqSearchGridRequest;
|
|
11
|
+import com.oqpo.api.web.dto.request.pomng.pchReq.SavePchReqlRequest;
|
|
12
|
+import com.oqpo.api.web.dto.response.DataResponse;
|
|
13
|
+import com.oqpo.api.web.dto.response.GridResponse;
|
|
14
|
+import com.oqpo.api.web.dto.response.SaveResponse;
|
|
15
|
+import com.oqpo.api.web.dto.response.oper.affl.AfflShopInfoResponse;
|
|
16
|
+import com.oqpo.api.web.dto.response.pomng.pchReq.PchReqInfoResponse;
|
|
17
|
+import io.swagger.annotations.Api;
|
|
18
|
+import io.swagger.annotations.ApiImplicitParam;
|
|
19
|
+import io.swagger.annotations.ApiImplicitParams;
|
|
20
|
+import io.swagger.annotations.ApiOperation;
|
|
21
|
+import lombok.extern.slf4j.Slf4j;
|
|
22
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
23
|
+import org.springframework.http.ResponseEntity;
|
|
24
|
+import org.springframework.web.bind.annotation.*;
|
|
25
|
+import springfox.documentation.annotations.ApiIgnore;
|
|
26
|
+
|
|
27
|
+import javax.validation.Valid;
|
|
28
|
+
|
|
29
|
+@Slf4j
|
|
30
|
+@RestController
|
|
31
|
+@RequestMapping("/api/pomng")
|
|
32
|
+@Api(tags = {"구매요청 관리 (PchReqController) -- 진행중"})
|
|
33
|
+public class PchReqController {
|
|
34
|
+ @Autowired
|
|
35
|
+ private PchReqService pchReqService;
|
|
36
|
+
|
|
37
|
+ /**
|
|
38
|
+ * 설명 : 구매요청 그리드 리스트
|
|
39
|
+ *
|
|
40
|
+ * @param afflShopBaseInfoGridRequest
|
|
41
|
+ * @return
|
|
42
|
+ * @throws Exception
|
|
43
|
+ */
|
|
44
|
+
|
|
45
|
+ @ApiImplicitParams({
|
|
46
|
+ @ApiImplicitParam(name = "X-AUTH-TOKEN", value = "CONN-KEY", required = true, dataType = "String", paramType = "header")
|
|
47
|
+ })
|
|
48
|
+ @ApiOperation(value = " 구매요청 그리드 리스트")
|
|
49
|
+ @PostMapping("/detail-grid-list")
|
|
50
|
+ public ResponseEntity<GridResponse> detailGridList(@RequestBody @Valid PchReqSearchGridRequest pchReqSearchGridRequest) throws Exception {
|
|
51
|
+ return ResponseEntity.ok(pchReqService.selectPchReqGridList(pchReqSearchGridRequest.getSBrandId(), pchReqSearchGridRequest.getFromDt(), pchReqSearchGridRequest.getToDt(), pchReqSearchGridRequest.getSWhsId(), pchReqSearchGridRequest.getSPchReqStCd(), pchReqSearchGridRequest.getSItemNm(), pchReqSearchGridRequest.toDTO(pchReqSearchGridRequest)));
|
|
52
|
+ }
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+ /**
|
|
56
|
+ * 설명 : 구매요청 정보
|
|
57
|
+ *
|
|
58
|
+ * @param brandId, pchReqUnqNo
|
|
59
|
+ * @return
|
|
60
|
+ * @throws Exception
|
|
61
|
+ */
|
|
62
|
+ @ApiImplicitParams({
|
|
63
|
+ @ApiImplicitParam(name = "X-AUTH-TOKEN", value = "CONN-KEY", required = true, dataType = "String", paramType = "header"),
|
|
64
|
+ @ApiImplicitParam(name = "brandId", value = "가맹점번호", required = true, dataType = "String", paramType = "query"),
|
|
65
|
+ @ApiImplicitParam(name = "pchReqUnqNo", value = "구매요청번호", required = true, dataType = "String", paramType = "query")
|
|
66
|
+ })
|
|
67
|
+ @ApiOperation(value = "구매요청 정보")
|
|
68
|
+ @GetMapping("/info-pchReq")
|
|
69
|
+ public ResponseEntity<PchReqInfoResponse> infoUser(@RequestParam(value = "brandId") String brandId, @RequestParam(value = "pchReqUnqNo") String pchReqUnqNo) throws Exception {
|
|
70
|
+ return ResponseEntity.ok(pchReqService.selectPchReqInfo(brandId,pchReqUnqNo));
|
|
71
|
+ }
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+ /**
|
|
75
|
+ * 설명 : 구매요청 정보 저장
|
|
76
|
+ *
|
|
77
|
+ * @param userId
|
|
78
|
+ * @param savePchReqlRequest
|
|
79
|
+ * @return SaveResponse
|
|
80
|
+ * @throws Exception
|
|
81
|
+ */
|
|
82
|
+ @ApiImplicitParams({
|
|
83
|
+ @ApiImplicitParam(name = "X-AUTH-TOKEN", value = "CONN-KEY", required = true, dataType = "String", paramType = "header")
|
|
84
|
+ })
|
|
85
|
+ @ApiOperation(value = "구매요청 정보 저장")
|
|
86
|
+ @PostMapping("/save-pchReq")
|
|
87
|
+ public ResponseEntity<SaveResponse> savePchReq(@ApiIgnore String userId, @ApiIgnore String userNm, @RequestBody @Valid SavePchReqlRequest savePchReqlRequest) throws Exception {
|
|
88
|
+ pchReqService.savePchReqInfo(userId, userNm, savePchReqlRequest);
|
|
89
|
+ return ResponseEntity.ok(SaveResponse.toDTO(SystemMessageCode.SAVE_OK));
|
|
90
|
+ }
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+}
|