|
@@ -4,9 +4,11 @@ package com.oqpo.api.service.stockmng;
|
4
|
4
|
import com.oqpo.api.entity.CodeEntity;
|
5
|
5
|
import com.oqpo.api.entity.stockmng.*;
|
6
|
6
|
import com.oqpo.api.enums.SystemMessageCode;
|
|
7
|
+import com.oqpo.api.enums.WhsDvsn;
|
7
|
8
|
import com.oqpo.api.exception.GlobalException;
|
8
|
9
|
import com.oqpo.api.mapper.stockmng.WhsMngMapper;
|
9
|
10
|
import com.oqpo.api.service.CommonService;
|
|
11
|
+import com.oqpo.api.util.StringUtil;
|
10
|
12
|
import com.oqpo.api.web.dto.request.GridRequest;
|
11
|
13
|
import com.oqpo.api.web.dto.request.stockmng.SaveWhsInfoRequest;
|
12
|
14
|
import com.oqpo.api.web.dto.response.GridResponse;
|
|
@@ -107,6 +109,7 @@ public class WhsMngService extends CommonService {
|
107
|
109
|
entity.setAddr2(saveWhsInfoRequest.getAddr2());
|
108
|
110
|
entity.setWhsStCd(saveWhsInfoRequest.getWhsStCd());
|
109
|
111
|
entity.setStoreId(saveWhsInfoRequest.getStoreId());
|
|
112
|
+ entity.setWhsDvsn(StringUtil.isEmpty(entity.getStoreId()) ? WhsDvsn.BRAND.getCd() : WhsDvsn.STORE.getCd());
|
110
|
113
|
whsMngMapper.insertWhsMgntBaseInfo(userId, entity);
|
111
|
114
|
|
112
|
115
|
// 창고로케이션정보
|
|
@@ -143,6 +146,7 @@ public class WhsMngService extends CommonService {
|
143
|
146
|
entity.setAddr2(saveWhsInfoRequest.getAddr2());
|
144
|
147
|
entity.setWhsStCd(saveWhsInfoRequest.getWhsStCd());
|
145
|
148
|
entity.setStoreId(saveWhsInfoRequest.getStoreId());
|
|
149
|
+ entity.setWhsDvsn(StringUtil.isEmpty(entity.getStoreId()) ? WhsDvsn.BRAND.getCd() : WhsDvsn.STORE.getCd());
|
146
|
150
|
whsMngMapper.updateWhsMgntBaseInfo(userId, entity);
|
147
|
151
|
|
148
|
152
|
// 창고로케이션정보
|
|
@@ -250,7 +254,7 @@ public class WhsMngService extends CommonService {
|
250
|
254
|
int gridPage = gridRequest.getGridPage();
|
251
|
255
|
int gridSize = gridRequest.getGridSize();
|
252
|
256
|
|
253
|
|
- int gridRecords = 0 ;
|
|
257
|
+ int gridRecords = 0;
|
254
|
258
|
int gridTotal = 0;
|
255
|
259
|
|
256
|
260
|
//창고구분(브랜드 W01/매장 W02)
|
|
@@ -267,10 +271,10 @@ public class WhsMngService extends CommonService {
|
267
|
271
|
.brandNm(m.getBrandNm())
|
268
|
272
|
.whsId(m.getWhsId())
|
269
|
273
|
.whsNm(m.getWhsNm())
|
270
|
|
- .location(m.getLocationInfo() == null ? "" : m.getLocationInfo().getLocation() == null ? "" : m.getLocationInfo().getLocation() )
|
271
|
|
- .locationNm(m.getLocationInfo() == null ? "" : m.getLocationInfo().getLocationNm() == null ? "" : m.getLocationInfo().getLocationNm() )
|
272
|
|
- .stckDvsn(m.getLocationInfo() == null ? "" : m.getLocationInfo().getStckDvsn() == null ? "" : m.getLocationInfo().getStckDvsn() )
|
273
|
|
- .stckDvsnNm(m.getLocationInfo() == null ? "" : m.getLocationInfo().getStckDvsnNm() == null ? "" : m.getLocationInfo().getStckDvsnNm() )
|
|
274
|
+ .location(m.getLocationInfo() == null ? "" : m.getLocationInfo().getLocation() == null ? "" : m.getLocationInfo().getLocation())
|
|
275
|
+ .locationNm(m.getLocationInfo() == null ? "" : m.getLocationInfo().getLocationNm() == null ? "" : m.getLocationInfo().getLocationNm())
|
|
276
|
+ .stckDvsn(m.getLocationInfo() == null ? "" : m.getLocationInfo().getStckDvsn() == null ? "" : m.getLocationInfo().getStckDvsn())
|
|
277
|
+ .stckDvsnNm(m.getLocationInfo() == null ? "" : m.getLocationInfo().getStckDvsnNm() == null ? "" : m.getLocationInfo().getStckDvsnNm())
|
274
|
278
|
.build())
|
275
|
279
|
.collect(Collectors.toList());
|
276
|
280
|
return GridResponse.toDTO(gridPage, gridTotal, gridRecords, gridRows);
|