瀏覽代碼

가맹점, 브랜드, 공급사 첨부파일 가져오기 기능 추가

dwkim 2 年之前
父節點
當前提交
4dd2f15f60

+ 1 - 0
src/main/java/com/oqpo/api/entity/oper/AfflEntity.java

@@ -50,5 +50,6 @@ public class AfflEntity implements Serializable {
50 50
     private String joinDt;
51 51
 
52 52
     private List<AfflSaleInfoEntity> afflSaleInfo;
53
+    private List<FileEntity> fileEntity ;
53 54
 
54 55
 }

+ 4 - 0
src/main/java/com/oqpo/api/entity/stinfo/BrandEntity.java

@@ -1,10 +1,12 @@
1 1
 package com.oqpo.api.entity.stinfo;
2 2
 
3
+import com.oqpo.api.entity.oper.FileEntity;
3 4
 import lombok.Getter;
4 5
 import lombok.Setter;
5 6
 import lombok.ToString;
6 7
 
7 8
 import java.io.Serializable;
9
+import java.util.List;
8 10
 
9 11
 @Getter
10 12
 @Setter
@@ -44,4 +46,6 @@ public class BrandEntity implements Serializable {
44 46
     private String sysChgDttm;
45 47
     private String sysChgId;
46 48
 
49
+    private List<FileEntity> fileEntity ;
50
+
47 51
 }

+ 5 - 0
src/main/java/com/oqpo/api/entity/stinfo/SpplyEntity.java

@@ -1,5 +1,6 @@
1 1
 package com.oqpo.api.entity.stinfo;
2 2
 
3
+import com.oqpo.api.entity.oper.FileEntity;
3 4
 import lombok.Getter;
4 5
 import lombok.Setter;
5 6
 import lombok.ToString;
@@ -54,6 +55,10 @@ public class SpplyEntity implements Serializable {
54 55
     private String sysChgDttm;
55 56
     private String sysChgId;
56 57
 
58
+    private List<FileEntity> fileBookCopyEntity ;
59
+
60
+    private List<FileEntity> fileBsnsRegEntity ;
61
+
57 62
     List<SpplyMgrEntity> spplyMgrInfo ;
58 63
 
59 64
 }

+ 19 - 2
src/main/java/com/oqpo/api/service/oper/AfflService.java

@@ -3,8 +3,10 @@ package com.oqpo.api.service.oper;
3 3
 
4 4
 import com.oqpo.api.entity.oper.AfflEntity;
5 5
 import com.oqpo.api.entity.oper.AfflSaleInfoEntity;
6
+import com.oqpo.api.entity.oper.FileEntity;
6 7
 import com.oqpo.api.entity.oper.UserMngEntity;
7 8
 import com.oqpo.api.exception.GlobalException;
9
+import com.oqpo.api.mapper.FileMapper;
8 10
 import com.oqpo.api.mapper.oper.AfflMapper;
9 11
 import com.oqpo.api.mapper.oper.UserMngMapper;
10 12
 import com.oqpo.api.service.CommonService;
@@ -20,6 +22,7 @@ import org.springframework.security.crypto.password.PasswordEncoder;
20 22
 import org.springframework.stereotype.Service;
21 23
 import org.springframework.transaction.annotation.Transactional;
22 24
 
25
+import java.util.ArrayList;
23 26
 import java.util.List;
24 27
 import java.util.stream.Collectors;
25 28
 
@@ -35,6 +38,10 @@ public class AfflService extends CommonService {
35 38
     @Autowired
36 39
     private UserMngMapper userMngMapper;
37 40
 
41
+    @Autowired
42
+    private FileMapper fileMapper;
43
+
44
+
38 45
     /*
39 46
       가맹점 리스트 조회
40 47
      */
@@ -95,8 +102,18 @@ public class AfflService extends CommonService {
95 102
 
96 103
     /* 가맹점 정보 */
97 104
     public AfflShopInfoResponse selectAfflShopInfo(String afflShopId) throws Exception {
98
-        return AfflShopInfoResponse.toDTO(afflMapper.selectAfflShopBaseInfo(afflShopId),
99
-                  afflMapper.selectAfflSaleTargetList(afflShopId));
105
+        AfflEntity entity = afflMapper.selectAfflShopBaseInfo(afflShopId);
106
+        List<AfflSaleInfoEntity> saleList = afflMapper.selectAfflSaleTargetList(afflShopId);
107
+        List<FileEntity> logFileList = null;
108
+
109
+        if (!"".equals(entity.getCmpnyLogoFileNo())) {
110
+            logFileList = fileMapper.selectFileList(entity.getCmpnyLogoFileNo()) ;
111
+        } else {
112
+            logFileList = new ArrayList<FileEntity>();
113
+        }
114
+
115
+        List<FileEntity> nFileList = null;
116
+        return AfflShopInfoResponse.toDTO(entity,saleList, logFileList );
100 117
     }
101 118
 
102 119
     /* 가맹점 저장 */

+ 20 - 3
src/main/java/com/oqpo/api/service/stinfo/BrandService.java

@@ -2,10 +2,10 @@ package com.oqpo.api.service.stinfo;
2 2
 
3 3
 
4 4
 
5
-import com.oqpo.api.entity.oper.SaleMgrMgntEntity;
6
-import com.oqpo.api.entity.oper.UserMngEntity;
5
+import com.oqpo.api.entity.oper.*;
7 6
 import com.oqpo.api.entity.stinfo.BrandEntity;
8 7
 import com.oqpo.api.exception.GlobalException;
8
+import com.oqpo.api.mapper.FileMapper;
9 9
 import com.oqpo.api.mapper.oper.UserMngMapper;
10 10
 import com.oqpo.api.mapper.stinfo.BrandMapper;
11 11
 import com.oqpo.api.service.CommonService;
@@ -13,6 +13,7 @@ import com.oqpo.api.web.dto.request.GridRequest;
13 13
 import com.oqpo.api.web.dto.request.oper.salemgr.SaveSaleMgrMgnlRequest;
14 14
 import com.oqpo.api.web.dto.request.stinfo.brand.SaveBrandInfolRequest;
15 15
 import com.oqpo.api.web.dto.response.GridResponse;
16
+import com.oqpo.api.web.dto.response.oper.affl.AfflShopInfoResponse;
16 17
 import com.oqpo.api.web.dto.response.oper.salemgr.SaleMgrMgnInfoResponse;
17 18
 import com.oqpo.api.web.dto.response.stinfo.brand.BrandInfoResponse;
18 19
 import com.oqpo.api.web.dto.response.stinfo.brand.BrandSearchListResponse;
@@ -24,6 +25,7 @@ import org.springframework.security.crypto.password.PasswordEncoder;
24 25
 import org.springframework.stereotype.Service;
25 26
 import org.springframework.transaction.annotation.Transactional;
26 27
 
28
+import java.util.ArrayList;
27 29
 import java.util.List;
28 30
 import java.util.stream.Collectors;
29 31
 
@@ -39,6 +41,9 @@ public class BrandService extends CommonService {
39 41
     @Autowired
40 42
     private UserMngMapper userMngMapper;
41 43
 
44
+    @Autowired
45
+    private FileMapper fileMapper;
46
+
42 47
     /*
43 48
       session 브랜드 리스트 조회
44 49
      */
@@ -106,7 +111,19 @@ public class BrandService extends CommonService {
106 111
 
107 112
     /* 브랜드 정보 */
108 113
     public BrandInfoResponse selectSaleMgrMgn(String brandId) throws Exception {
109
-        return BrandInfoResponse.toDTO(brandMapper.selectBrandInfo(brandId));
114
+
115
+        BrandEntity entity = brandMapper.selectBrandInfo(brandId);
116
+        List<FileEntity> logFileList = null;
117
+
118
+        if (!"".equals(entity.getBrandLogoFileNo())) {
119
+            logFileList = fileMapper.selectFileList(entity.getBrandLogoFileNo()) ;
120
+        } else {
121
+            logFileList = new ArrayList<FileEntity>();
122
+        }
123
+
124
+        List<FileEntity> nFileList = null;
125
+        return BrandInfoResponse.toDTO(entity,logFileList );
126
+
110 127
     }
111 128
 
112 129
     /* 브랜드 저장 */

+ 29 - 2
src/main/java/com/oqpo/api/service/stinfo/SpplyService.java

@@ -3,10 +3,13 @@ package com.oqpo.api.service.stinfo;
3 3
 
4 4
 import com.oqpo.api.entity.oper.AfflEntity;
5 5
 import com.oqpo.api.entity.oper.AfflSaleInfoEntity;
6
+import com.oqpo.api.entity.oper.FileEntity;
6 7
 import com.oqpo.api.entity.oper.UserMngEntity;
8
+import com.oqpo.api.entity.stinfo.BrandEntity;
7 9
 import com.oqpo.api.entity.stinfo.SpplyEntity;
8 10
 import com.oqpo.api.entity.stinfo.SpplyMgrEntity;
9 11
 import com.oqpo.api.exception.GlobalException;
12
+import com.oqpo.api.mapper.FileMapper;
10 13
 import com.oqpo.api.mapper.oper.AfflMapper;
11 14
 import com.oqpo.api.mapper.oper.UserMngMapper;
12 15
 import com.oqpo.api.mapper.stinfo.SupplyMapper;
@@ -18,6 +21,7 @@ import com.oqpo.api.web.dto.response.GridResponse;
18 21
 import com.oqpo.api.web.dto.response.oper.affl.AfflSearchResponse;
19 22
 import com.oqpo.api.web.dto.response.oper.affl.AfflShopInfoResponse;
20 23
 import com.oqpo.api.web.dto.response.stinfo.affl.AfflShopBaseInfoSearchResponse;
24
+import com.oqpo.api.web.dto.response.stinfo.brand.BrandInfoResponse;
21 25
 import com.oqpo.api.web.dto.response.stinfo.spply.SpplyInfoResponse;
22 26
 import com.oqpo.api.web.dto.response.stinfo.spply.SpplyPopSearchResponse;
23 27
 import com.oqpo.api.web.dto.response.stinfo.spply.SpplySearchResponse;
@@ -28,6 +32,7 @@ import org.springframework.security.crypto.password.PasswordEncoder;
28 32
 import org.springframework.stereotype.Service;
29 33
 import org.springframework.transaction.annotation.Transactional;
30 34
 
35
+import java.util.ArrayList;
31 36
 import java.util.List;
32 37
 import java.util.stream.Collectors;
33 38
 
@@ -43,6 +48,9 @@ public class SpplyService extends CommonService {
43 48
     @Autowired
44 49
     private UserMngMapper userMngMapper;
45 50
 
51
+    @Autowired
52
+    private FileMapper fileMapper;
53
+
46 54
     /*
47 55
       팝업 공급사 리스트 조회
48 56
      */
@@ -96,8 +104,27 @@ public class SpplyService extends CommonService {
96 104
 
97 105
     /* 공급사 정보 */
98 106
     public SpplyInfoResponse selectSpplyInfo(String brandId, String spplyId) throws Exception {
99
-        return SpplyInfoResponse.toDTO(supplyMapper.selectSpplyInfo(brandId, spplyId),
100
-                supplyMapper.selectSpplyMgrList(spplyId));
107
+
108
+        SpplyEntity entity = supplyMapper.selectSpplyInfo(brandId, spplyId);
109
+        List<SpplyMgrEntity> supplyList = supplyMapper.selectSpplyMgrList(spplyId);
110
+
111
+        List<FileEntity> bookCopyFileList = null;
112
+        List<FileEntity> bsnsRegNoFileList = null;
113
+
114
+        if (!"".equals(entity.getBbookCopyFileNo())) {
115
+            bookCopyFileList = fileMapper.selectFileList(entity.getBbookCopyFileNo()) ;
116
+        } else {
117
+            bookCopyFileList = new ArrayList<FileEntity>();
118
+        }
119
+
120
+        if (!"".equals(entity.getBsnsRegFileNo())) {
121
+            bsnsRegNoFileList = fileMapper.selectFileList(entity.getBsnsRegFileNo()) ;
122
+        } else {
123
+            bsnsRegNoFileList = new ArrayList<FileEntity>();
124
+        }
125
+
126
+
127
+        return SpplyInfoResponse.toDTO(entity,supplyList, bookCopyFileList, bsnsRegNoFileList) ;
101 128
     }
102 129
 
103 130
     /* 공급사 저장 */

+ 36 - 1
src/main/java/com/oqpo/api/web/dto/response/oper/affl/AfflShopInfoResponse.java

@@ -4,6 +4,8 @@ import com.fasterxml.jackson.annotation.JsonInclude;
4 4
 import com.oqpo.api.entity.CodeEntity;
5 5
 import com.oqpo.api.entity.oper.AfflEntity;
6 6
 import com.oqpo.api.entity.oper.AfflSaleInfoEntity;
7
+import com.oqpo.api.entity.oper.FileEntity;
8
+import com.oqpo.api.web.dto.response.oper.ntice.NticeResponse;
7 9
 import io.swagger.annotations.ApiModelProperty;
8 10
 import lombok.*;
9 11
 
@@ -93,10 +95,13 @@ public class AfflShopInfoResponse {
93 95
     @ApiModelProperty(value = "기업형태명")
94 96
     private String corpTypeNm ;
95 97
 
98
+    @ApiModelProperty(value = "로그파일 정보")
99
+    private List<AfflShopInfoResponse.FileLogInfo> fileLogNoList;
100
+
96 101
     @ApiModelProperty(value = "영업담당자 리스트")
97 102
     private List<AfflSaleInfo> saleList;
98 103
 
99
-    public static AfflShopInfoResponse toDTO(AfflEntity entity, List<AfflSaleInfoEntity> afflSaleList) {
104
+    public static AfflShopInfoResponse toDTO(AfflEntity entity, List<AfflSaleInfoEntity> afflSaleList, List<FileEntity>  fileLogInfoList) {
100 105
         if (entity == null) return null;
101 106
         return AfflShopInfoResponse.builder()
102 107
                 .afflShopId(entity.getAfflShopId())
@@ -122,6 +127,15 @@ public class AfflShopInfoResponse {
122 127
                 .joinSttDt(entity.getJoinSttDt() == null ? "" : entity.getJoinSttDt())
123 128
                 .joinEndDt(entity.getJoinEndDt() == null ? "" : entity.getJoinEndDt())
124 129
                 .cmpnyLogoFileNo(entity.getCmpnyLogoFileNo() == null ? "" : entity.getCmpnyLogoFileNo())
130
+                .fileLogNoList(fileLogInfoList.stream()
131
+                        .map(m -> AfflShopInfoResponse.FileLogInfo.builder()
132
+                                .fileNo(m.getFileNo())
133
+                                .fileSeq(m.getFileSeq())
134
+                                .filePath(m.getFilePath())
135
+                                .fileNm(m.getFileNm())
136
+                                .fileOrgNm(m.getFileOrgNm())
137
+                                .build())
138
+                        .collect(Collectors.toList()))
125 139
                 .corpType(entity.getCorpType() == null ? "" : entity.getCorpType())
126 140
                 .corpTypeNm(entity.getCorpTypeNm() == null ? "" : entity.getCorpTypeNm())
127 141
                 .saleList(afflSaleList.stream()
@@ -162,5 +176,26 @@ public class AfflShopInfoResponse {
162 176
 
163 177
         @ApiModelProperty(value = "상태명")
164 178
         private String stNm;
179
+
180
+    }
181
+
182
+    @Getter
183
+    @Builder
184
+    @AllArgsConstructor(access = AccessLevel.PROTECTED)
185
+    static class FileLogInfo {
186
+        @ApiModelProperty(value = "파일번호")
187
+        private String fileNo;
188
+
189
+        @ApiModelProperty(value = "파일순번")
190
+        private Integer fileSeq;
191
+
192
+        @ApiModelProperty(value = "파일경로")
193
+        private String filePath;
194
+
195
+        @ApiModelProperty(value = "파일명")
196
+        private String fileNm;
197
+
198
+        @ApiModelProperty(value = "원파일명")
199
+        private String fileOrgNm;
165 200
     }
166 201
 }

+ 39 - 2
src/main/java/com/oqpo/api/web/dto/response/stinfo/brand/BrandInfoResponse.java

@@ -1,11 +1,16 @@
1 1
 package com.oqpo.api.web.dto.response.stinfo.brand;
2 2
 
3 3
 import com.fasterxml.jackson.annotation.JsonInclude;
4
+import com.oqpo.api.entity.oper.FileEntity;
4 5
 import com.oqpo.api.entity.oper.SaleMgrMgntEntity;
5 6
 import com.oqpo.api.entity.stinfo.BrandEntity;
7
+import com.oqpo.api.web.dto.response.oper.affl.AfflShopInfoResponse;
6 8
 import io.swagger.annotations.ApiModelProperty;
7 9
 import lombok.*;
8 10
 
11
+import java.util.List;
12
+import java.util.stream.Collectors;
13
+
9 14
 
10 15
 @Getter
11 16
 @Setter
@@ -101,13 +106,16 @@ public class BrandInfoResponse {
101 106
     @ApiModelProperty(value = "시스템변경자")
102 107
     private String sysChgId;
103 108
 
104
-    public static BrandInfoResponse toDTO(BrandEntity entity) {
109
+    @ApiModelProperty(value = "로그파일 정보")
110
+    private List<BrandInfoResponse.FileLogInfo> fileLogNoList;
111
+
112
+    public static BrandInfoResponse toDTO(BrandEntity entity, List<FileEntity>  fileLogInfoList) {
105 113
         if (entity == null) return null;
106 114
         return BrandInfoResponse.builder()
107 115
                 .brandId(entity.getBrandId())
108 116
                 .brandNm(entity.getBrandNm())
109 117
                 .stCd(entity.getStCd())
110
-                .stNm(entity.getStNm())
118
+                .stNm(entity.getStNm() == null ? "" :entity.getStNm())
111 119
                 .brandType(entity.getBrandType() == null ? "" :entity.getBrandType())
112 120
                 .brandTypeNm(entity.getBrandTypeNm() == null ? "" :entity.getBrandTypeNm())
113 121
                 .zipNo(entity.getZipNo() == null ? "" :entity.getZipNo())
@@ -126,6 +134,15 @@ public class BrandInfoResponse {
126 134
                 .owacNm(entity.getOwacNm() == null ? "" :entity.getOwacNm())
127 135
                 .afflShopId(entity.getAfflShopId() == null ? "" :entity.getAfflShopId())
128 136
                 .brandLogoFileNo(entity.getBrandLogoFileNo() == null ? "" :entity.getBrandLogoFileNo())
137
+                .fileLogNoList(fileLogInfoList.stream()
138
+                        .map(m -> BrandInfoResponse.FileLogInfo.builder()
139
+                                .fileNo(m.getFileNo())
140
+                                .fileSeq(m.getFileSeq())
141
+                                .filePath(m.getFilePath())
142
+                                .fileNm(m.getFileNm())
143
+                                .fileOrgNm(m.getFileOrgNm())
144
+                                .build())
145
+                        .collect(Collectors.toList()))
129 146
                 .bsnsRegNo(entity.getBsnsRegNo() == null ? "" :entity.getBsnsRegNo())
130 147
                 .corpRegNo(entity.getCorpRegNo() == null ? "" :entity.getCorpRegNo())
131 148
                 .oqBrandId(entity.getOqBrandId() == null ? "" :entity.getOqBrandId())
@@ -135,4 +152,24 @@ public class BrandInfoResponse {
135 152
                 .sysChgId(entity.getSysChgId())
136 153
                 .build();
137 154
     }
155
+
156
+    @Getter
157
+    @Builder
158
+    @AllArgsConstructor(access = AccessLevel.PROTECTED)
159
+    static class FileLogInfo {
160
+        @ApiModelProperty(value = "파일번호")
161
+        private String fileNo;
162
+
163
+        @ApiModelProperty(value = "파일순번")
164
+        private Integer fileSeq;
165
+
166
+        @ApiModelProperty(value = "파일경로")
167
+        private String filePath;
168
+
169
+        @ApiModelProperty(value = "파일명")
170
+        private String fileNm;
171
+
172
+        @ApiModelProperty(value = "원파일명")
173
+        private String fileOrgNm;
174
+    }
138 175
 }

+ 47 - 1
src/main/java/com/oqpo/api/web/dto/response/stinfo/spply/SpplyInfoResponse.java

@@ -3,8 +3,10 @@ package com.oqpo.api.web.dto.response.stinfo.spply;
3 3
 import com.fasterxml.jackson.annotation.JsonInclude;
4 4
 import com.oqpo.api.entity.oper.AfflEntity;
5 5
 import com.oqpo.api.entity.oper.AfflSaleInfoEntity;
6
+import com.oqpo.api.entity.oper.FileEntity;
6 7
 import com.oqpo.api.entity.stinfo.SpplyEntity;
7 8
 import com.oqpo.api.entity.stinfo.SpplyMgrEntity;
9
+import com.oqpo.api.web.dto.response.stinfo.brand.BrandInfoResponse;
8 10
 import io.swagger.annotations.ApiModelProperty;
9 11
 import lombok.*;
10 12
 
@@ -135,10 +137,16 @@ public class SpplyInfoResponse {
135 137
     @ApiModelProperty(value = "수정자")
136 138
     private String sysChgId;
137 139
 
140
+    @ApiModelProperty(value = "통장사본파일 정보")
141
+    private List<SpplyInfoResponse.FileAddInfo> fileBookCopyNoList;
142
+
143
+    @ApiModelProperty(value = "사업자등록증파일  정보")
144
+    private List<SpplyInfoResponse.FileAddInfo> fileBsnsRegNoList;
145
+
138 146
     @ApiModelProperty(value = "공급사 담당자 리스트")
139 147
     private List<SpprMgrInfo> spplyMgrList;
140 148
 
141
-    public static SpplyInfoResponse toDTO(SpplyEntity entity, List<SpplyMgrEntity> spplyMgrList) {
149
+    public static SpplyInfoResponse toDTO(SpplyEntity entity, List<SpplyMgrEntity> spplyMgrList, List<FileEntity>  fileBookCopyInfoList, List<FileEntity>  fileBsnsRegNoInfoList) {
142 150
         if (entity == null) return null;
143 151
         return SpplyInfoResponse.builder()
144 152
                 .spplyId(entity.getSpplyId())
@@ -173,7 +181,25 @@ public class SpplyInfoResponse {
173 181
                 .acctNo(entity.getAcctNo() == null ? "" : entity.getAcctNo() )
174 182
                 .owacNm(entity.getOwacNm() == null ? "" :entity.getOwacNm() )
175 183
                 .bbookCopyFileNo(entity.getBbookCopyFileNo() == null ? "" : entity.getBbookCopyFileNo())
184
+                .fileBookCopyNoList(fileBookCopyInfoList.stream()
185
+                        .map(m -> SpplyInfoResponse.FileAddInfo.builder()
186
+                                .fileNo(m.getFileNo())
187
+                                .fileSeq(m.getFileSeq())
188
+                                .filePath(m.getFilePath())
189
+                                .fileNm(m.getFileNm())
190
+                                .fileOrgNm(m.getFileOrgNm())
191
+                                .build())
192
+                        .collect(Collectors.toList()))
176 193
                 .bsnsRegFileNo(entity.getBsnsRegFileNo() == null ? "" : entity.getBsnsRegFileNo())
194
+                .fileBsnsRegNoList(fileBsnsRegNoInfoList.stream()
195
+                        .map(m -> SpplyInfoResponse.FileAddInfo.builder()
196
+                                .fileNo(m.getFileNo())
197
+                                .fileSeq(m.getFileSeq())
198
+                                .filePath(m.getFilePath())
199
+                                .fileNm(m.getFileNm())
200
+                                .fileOrgNm(m.getFileOrgNm())
201
+                                .build())
202
+                        .collect(Collectors.toList()))
177 203
                 .latX(entity.getLatX() == null ? "" :entity.getLatX() )
178 204
                 .longY(entity.getLongY() == null ? "" : entity.getLongY() )
179 205
                 .sysRegDttm(entity.getSysRegDttm() == null ? "" :entity.getSysRegDttm() )
@@ -221,4 +247,24 @@ public class SpplyInfoResponse {
221 247
         private String assgnTaskNm;
222 248
 
223 249
     }
250
+
251
+    @Getter
252
+    @Builder
253
+    @AllArgsConstructor(access = AccessLevel.PROTECTED)
254
+    static class FileAddInfo {
255
+        @ApiModelProperty(value = "파일번호")
256
+        private String fileNo;
257
+
258
+        @ApiModelProperty(value = "파일순번")
259
+        private Integer fileSeq;
260
+
261
+        @ApiModelProperty(value = "파일경로")
262
+        private String filePath;
263
+
264
+        @ApiModelProperty(value = "파일명")
265
+        private String fileNm;
266
+
267
+        @ApiModelProperty(value = "원파일명")
268
+        private String fileOrgNm;
269
+    }
224 270
 }