|
@@ -1,6 +1,7 @@
|
1
|
package com.oqpo.api.service.stinfo;
|
1
|
package com.oqpo.api.service.stinfo;
|
2
|
|
2
|
|
3
|
|
3
|
|
|
|
4
|
+import com.oqpo.api.client.oqlink.OqlinkClient;
|
4
|
import com.oqpo.api.entity.CodeEntity;
|
5
|
import com.oqpo.api.entity.CodeEntity;
|
5
|
import com.oqpo.api.entity.oper.FileEntity;
|
6
|
import com.oqpo.api.entity.oper.FileEntity;
|
6
|
import com.oqpo.api.entity.oper.UserMngEntity;
|
7
|
import com.oqpo.api.entity.oper.UserMngEntity;
|
|
@@ -48,27 +49,29 @@ public class ItemUnitService extends CommonService {
|
48
|
@Autowired
|
49
|
@Autowired
|
49
|
private StoreItemUnitMapper storeItemUnitMapper;
|
50
|
private StoreItemUnitMapper storeItemUnitMapper;
|
50
|
|
51
|
|
51
|
-
|
|
|
52
|
@Autowired
|
52
|
@Autowired
|
53
|
private FileMapper fileMapper;
|
53
|
private FileMapper fileMapper;
|
54
|
|
54
|
|
55
|
-
|
|
|
56
|
@Autowired
|
55
|
@Autowired
|
57
|
private UserMngMapper userMngMapper;
|
56
|
private UserMngMapper userMngMapper;
|
|
|
57
|
+
|
|
|
58
|
+ @Autowired
|
|
|
59
|
+ private OqlinkClient oqlinkClient;
|
|
|
60
|
+
|
58
|
/*
|
61
|
/*
|
59
|
브랜드 공급사 단가 리스트 조회
|
62
|
브랜드 공급사 단가 리스트 조회
|
60
|
|
63
|
|
61
|
*/
|
64
|
*/
|
62
|
- public GridResponse selectItemUnitGridList(String sBrandId, String fromDt, String toDt,String sUnitStCd, String sSpplyId, String sClass1, String sClass2, String sClass3, String sClass4, String sItemNm, GridRequest gridRequest) throws Exception {
|
|
|
|
|
65
|
+ public GridResponse selectItemUnitGridList(String sBrandId, String fromDt, String toDt, String sUnitStCd, String sSpplyId, String sClass1, String sClass2, String sClass3, String sClass4, String sItemNm, GridRequest gridRequest) throws Exception {
|
63
|
int gridPage = gridRequest.getGridPage();
|
66
|
int gridPage = gridRequest.getGridPage();
|
64
|
int gridSize = gridRequest.getGridSize();
|
67
|
int gridSize = gridRequest.getGridSize();
|
65
|
|
68
|
|
66
|
fromDt = fromDt == null ? null : fromDt.replace(".", "");
|
69
|
fromDt = fromDt == null ? null : fromDt.replace(".", "");
|
67
|
toDt = toDt == null ? null : toDt.replace(".", "");
|
70
|
toDt = toDt == null ? null : toDt.replace(".", "");
|
68
|
|
71
|
|
69
|
- int gridRecords = itemUnitMapper.selectItemUnitGridCnt( sBrandId, fromDt, toDt, sUnitStCd, sSpplyId, sClass1, sClass2, sClass3, sClass4,sItemNm );
|
|
|
|
|
72
|
+ int gridRecords = itemUnitMapper.selectItemUnitGridCnt(sBrandId, fromDt, toDt, sUnitStCd, sSpplyId, sClass1, sClass2, sClass3, sClass4, sItemNm);
|
70
|
int gridTotal = fnCalculateGridTotal(gridSize, gridRecords);
|
73
|
int gridTotal = fnCalculateGridTotal(gridSize, gridRecords);
|
71
|
- List<ItemUnitEntity> entities = itemUnitMapper.selectItemUnitGridList(sBrandId, fromDt, toDt, sUnitStCd, sSpplyId, sClass1, sClass2, sClass3, sClass4,sItemNm, gridRequest);
|
|
|
|
|
74
|
+ List<ItemUnitEntity> entities = itemUnitMapper.selectItemUnitGridList(sBrandId, fromDt, toDt, sUnitStCd, sSpplyId, sClass1, sClass2, sClass3, sClass4, sItemNm, gridRequest);
|
72
|
List<Object> gridRows = entities.stream()
|
75
|
List<Object> gridRows = entities.stream()
|
73
|
.map(m -> ItemUnitSearchResponse.builder()
|
76
|
.map(m -> ItemUnitSearchResponse.builder()
|
74
|
.viewCd("R")
|
77
|
.viewCd("R")
|
|
@@ -78,18 +81,18 @@ public class ItemUnitService extends CommonService {
|
78
|
.itemNm(m.getItemNm())
|
81
|
.itemNm(m.getItemNm())
|
79
|
.spplyId(m.getSpplyId())
|
82
|
.spplyId(m.getSpplyId())
|
80
|
.spplyNm(m.getSpplyNm())
|
83
|
.spplyNm(m.getSpplyNm())
|
81
|
- .contSttDt(m.getContSttDt() == null ? "" :m.getContSttDt())
|
|
|
82
|
- .contEndDt(m.getContEndDt() == null ? "" :m.getContEndDt())
|
|
|
83
|
- .curr(m.getCurr() == null ? "" :m.getCurr())
|
|
|
84
|
- .currNm(m.getCurrNm() == null ? "" :m.getCurrNm() )
|
|
|
85
|
- .unit(m.getUnit() == null ? "" :m.getUnit())
|
|
|
86
|
- .unitNm(m.getUnitNm() == null ? "" :m.getUnitNm())
|
|
|
87
|
- .unitAmt(m.getUnitAmt() == null ? 0 :m.getUnitAmt())
|
|
|
88
|
- .leadTime(m.getLeadTime() == null ? 0 :m.getLeadTime())
|
|
|
89
|
- .spplyItemId(m.getSpplyItemId() == null ? "" :m.getSpplyItemId())
|
|
|
90
|
- .unitStCd(m.getUnitStCd() == null ? "" :m.getUnitStCd())
|
|
|
91
|
- .unitStNm(m.getUnitStNm() == null ? "" :m.getUnitStNm())
|
|
|
92
|
- .stddQty(m.getStddQty() == null ? 0 :m.getStddQty() )
|
|
|
|
|
84
|
+ .contSttDt(m.getContSttDt() == null ? "" : m.getContSttDt())
|
|
|
85
|
+ .contEndDt(m.getContEndDt() == null ? "" : m.getContEndDt())
|
|
|
86
|
+ .curr(m.getCurr() == null ? "" : m.getCurr())
|
|
|
87
|
+ .currNm(m.getCurrNm() == null ? "" : m.getCurrNm())
|
|
|
88
|
+ .unit(m.getUnit() == null ? "" : m.getUnit())
|
|
|
89
|
+ .unitNm(m.getUnitNm() == null ? "" : m.getUnitNm())
|
|
|
90
|
+ .unitAmt(m.getUnitAmt() == null ? 0 : m.getUnitAmt())
|
|
|
91
|
+ .leadTime(m.getLeadTime() == null ? 0 : m.getLeadTime())
|
|
|
92
|
+ .spplyItemId(m.getSpplyItemId() == null ? "" : m.getSpplyItemId())
|
|
|
93
|
+ .unitStCd(m.getUnitStCd() == null ? "" : m.getUnitStCd())
|
|
|
94
|
+ .unitStNm(m.getUnitStNm() == null ? "" : m.getUnitStNm())
|
|
|
95
|
+ .stddQty(m.getStddQty() == null ? 0 : m.getStddQty())
|
93
|
.build())
|
96
|
.build())
|
94
|
.collect(Collectors.toList());
|
97
|
.collect(Collectors.toList());
|
95
|
return GridResponse.toDTO(gridPage, gridTotal, gridRecords, gridRows);
|
98
|
return GridResponse.toDTO(gridPage, gridTotal, gridRecords, gridRows);
|
|
@@ -99,16 +102,16 @@ public class ItemUnitService extends CommonService {
|
99
|
공급사단가 리스트 조회
|
102
|
공급사단가 리스트 조회
|
100
|
|
103
|
|
101
|
*/
|
104
|
*/
|
102
|
- public GridResponse selectSpplyItemUnitGridList(String sBrandId, String fromDt, String toDt,String sUnitStCd, String sSpplyId, String sItemNm, GridRequest gridRequest) throws Exception {
|
|
|
|
|
105
|
+ public GridResponse selectSpplyItemUnitGridList(String sBrandId, String fromDt, String toDt, String sUnitStCd, String sSpplyId, String sItemNm, GridRequest gridRequest) throws Exception {
|
103
|
int gridPage = gridRequest.getGridPage();
|
106
|
int gridPage = gridRequest.getGridPage();
|
104
|
int gridSize = gridRequest.getGridSize();
|
107
|
int gridSize = gridRequest.getGridSize();
|
105
|
|
108
|
|
106
|
fromDt = fromDt == null ? null : fromDt.replace(".", "");
|
109
|
fromDt = fromDt == null ? null : fromDt.replace(".", "");
|
107
|
toDt = toDt == null ? null : toDt.replace(".", "");
|
110
|
toDt = toDt == null ? null : toDt.replace(".", "");
|
108
|
|
111
|
|
109
|
- int gridRecords = itemUnitMapper.selectItemUnitGridCnt( sBrandId, fromDt, toDt, sUnitStCd, sSpplyId, "", "", "", "",sItemNm );
|
|
|
|
|
112
|
+ int gridRecords = itemUnitMapper.selectItemUnitGridCnt(sBrandId, fromDt, toDt, sUnitStCd, sSpplyId, "", "", "", "", sItemNm);
|
110
|
int gridTotal = fnCalculateGridTotal(gridSize, gridRecords);
|
113
|
int gridTotal = fnCalculateGridTotal(gridSize, gridRecords);
|
111
|
- List<ItemUnitEntity> entities = itemUnitMapper.selectItemUnitGridList(sBrandId, fromDt, toDt, sUnitStCd, sSpplyId, "", "", "", "",sItemNm, gridRequest);
|
|
|
|
|
114
|
+ List<ItemUnitEntity> entities = itemUnitMapper.selectItemUnitGridList(sBrandId, fromDt, toDt, sUnitStCd, sSpplyId, "", "", "", "", sItemNm, gridRequest);
|
112
|
List<Object> gridRows = entities.stream()
|
115
|
List<Object> gridRows = entities.stream()
|
113
|
.map(m -> ItemUnitSearchResponse.builder()
|
116
|
.map(m -> ItemUnitSearchResponse.builder()
|
114
|
.viewCd("R")
|
117
|
.viewCd("R")
|
|
@@ -118,38 +121,37 @@ public class ItemUnitService extends CommonService {
|
118
|
.itemNm(m.getItemNm())
|
121
|
.itemNm(m.getItemNm())
|
119
|
.spplyId(m.getSpplyId())
|
122
|
.spplyId(m.getSpplyId())
|
120
|
.spplyNm(m.getSpplyNm())
|
123
|
.spplyNm(m.getSpplyNm())
|
121
|
- .contSttDt(m.getContSttDt() == null ? "" :m.getContSttDt())
|
|
|
122
|
- .contEndDt(m.getContEndDt() == null ? "" :m.getContEndDt())
|
|
|
123
|
- .curr(m.getCurr() == null ? "" :m.getCurr())
|
|
|
124
|
- .currNm(m.getCurrNm() == null ? "" :m.getCurrNm() )
|
|
|
125
|
- .unit(m.getUnit() == null ? "" :m.getUnit())
|
|
|
126
|
- .unitNm(m.getUnitNm() == null ? "" :m.getUnitNm())
|
|
|
127
|
- .unitAmt(m.getUnitAmt() == null ? 0 :m.getUnitAmt())
|
|
|
128
|
- .leadTime(m.getLeadTime() == null ? 0 :m.getLeadTime())
|
|
|
129
|
- .spplyItemId(m.getSpplyItemId() == null ? "" :m.getSpplyItemId())
|
|
|
130
|
- .unitStCd(m.getUnitStCd() == null ? "" :m.getUnitStCd())
|
|
|
131
|
- .unitStNm(m.getUnitStNm() == null ? "" :m.getUnitStNm())
|
|
|
132
|
- .stddQty(m.getStddQty() == null ? 0 :m.getStddQty() )
|
|
|
|
|
124
|
+ .contSttDt(m.getContSttDt() == null ? "" : m.getContSttDt())
|
|
|
125
|
+ .contEndDt(m.getContEndDt() == null ? "" : m.getContEndDt())
|
|
|
126
|
+ .curr(m.getCurr() == null ? "" : m.getCurr())
|
|
|
127
|
+ .currNm(m.getCurrNm() == null ? "" : m.getCurrNm())
|
|
|
128
|
+ .unit(m.getUnit() == null ? "" : m.getUnit())
|
|
|
129
|
+ .unitNm(m.getUnitNm() == null ? "" : m.getUnitNm())
|
|
|
130
|
+ .unitAmt(m.getUnitAmt() == null ? 0 : m.getUnitAmt())
|
|
|
131
|
+ .leadTime(m.getLeadTime() == null ? 0 : m.getLeadTime())
|
|
|
132
|
+ .spplyItemId(m.getSpplyItemId() == null ? "" : m.getSpplyItemId())
|
|
|
133
|
+ .unitStCd(m.getUnitStCd() == null ? "" : m.getUnitStCd())
|
|
|
134
|
+ .unitStNm(m.getUnitStNm() == null ? "" : m.getUnitStNm())
|
|
|
135
|
+ .stddQty(m.getStddQty() == null ? 0 : m.getStddQty())
|
133
|
.build())
|
136
|
.build())
|
134
|
.collect(Collectors.toList());
|
137
|
.collect(Collectors.toList());
|
135
|
return GridResponse.toDTO(gridPage, gridTotal, gridRecords, gridRows);
|
138
|
return GridResponse.toDTO(gridPage, gridTotal, gridRecords, gridRows);
|
136
|
}
|
139
|
}
|
137
|
|
140
|
|
138
|
|
141
|
|
139
|
-
|
|
|
140
|
/* 공급사 단가 정보 */
|
142
|
/* 공급사 단가 정보 */
|
141
|
public ItemUnitInfoResponse selectItemUnitInfo(String brandId, String brandUnitUnqNo) throws Exception {
|
143
|
public ItemUnitInfoResponse selectItemUnitInfo(String brandId, String brandUnitUnqNo) throws Exception {
|
142
|
|
144
|
|
143
|
- ItemUnitEntity entity = itemUnitMapper.selectItemUnitInfo( brandId, brandUnitUnqNo);
|
|
|
|
|
145
|
+ ItemUnitEntity entity = itemUnitMapper.selectItemUnitInfo(brandId, brandUnitUnqNo);
|
144
|
List<FileEntity> fileContInfoList = null;
|
146
|
List<FileEntity> fileContInfoList = null;
|
145
|
|
147
|
|
146
|
if (!"".equals(entity.getShortContFileNo())) {
|
148
|
if (!"".equals(entity.getShortContFileNo())) {
|
147
|
- fileContInfoList = fileMapper.selectFileList(entity.getShortContFileNo()) ;
|
|
|
|
|
149
|
+ fileContInfoList = fileMapper.selectFileList(entity.getShortContFileNo());
|
148
|
} else {
|
150
|
} else {
|
149
|
fileContInfoList = new ArrayList<FileEntity>();
|
151
|
fileContInfoList = new ArrayList<FileEntity>();
|
150
|
}
|
152
|
}
|
151
|
|
153
|
|
152
|
- return ItemUnitInfoResponse.toDTO(entity,fileContInfoList );
|
|
|
|
|
154
|
+ return ItemUnitInfoResponse.toDTO(entity, fileContInfoList);
|
153
|
|
155
|
|
154
|
}
|
156
|
}
|
155
|
|
157
|
|
|
@@ -166,8 +168,8 @@ public class ItemUnitService extends CommonService {
|
166
|
entity.setItemNm(saveItemUnitInfolRequest.getItemNm());
|
168
|
entity.setItemNm(saveItemUnitInfolRequest.getItemNm());
|
167
|
entity.setSpplyId(saveItemUnitInfolRequest.getSpplyId());
|
169
|
entity.setSpplyId(saveItemUnitInfolRequest.getSpplyId());
|
168
|
entity.setSpplyNm(saveItemUnitInfolRequest.getSpplyNm());
|
170
|
entity.setSpplyNm(saveItemUnitInfolRequest.getSpplyNm());
|
169
|
- entity.setContSttDt(saveItemUnitInfolRequest.getContSttDt().replaceAll("\\.",""));
|
|
|
170
|
- entity.setContEndDt(saveItemUnitInfolRequest.getContEndDt().replaceAll("\\.",""));
|
|
|
|
|
171
|
+ entity.setContSttDt(saveItemUnitInfolRequest.getContSttDt().replaceAll("\\.", ""));
|
|
|
172
|
+ entity.setContEndDt(saveItemUnitInfolRequest.getContEndDt().replaceAll("\\.", ""));
|
171
|
entity.setCurr(saveItemUnitInfolRequest.getCurr());
|
173
|
entity.setCurr(saveItemUnitInfolRequest.getCurr());
|
172
|
entity.setUnit(saveItemUnitInfolRequest.getUnit());
|
174
|
entity.setUnit(saveItemUnitInfolRequest.getUnit());
|
173
|
entity.setUnitAmt(saveItemUnitInfolRequest.getUnitAmt());
|
175
|
entity.setUnitAmt(saveItemUnitInfolRequest.getUnitAmt());
|
|
@@ -189,7 +191,7 @@ public class ItemUnitService extends CommonService {
|
189
|
throw new GlobalException(SystemMessageCode.ERR_EXISTUNIT);
|
191
|
throw new GlobalException(SystemMessageCode.ERR_EXISTUNIT);
|
190
|
}
|
192
|
}
|
191
|
} else {
|
193
|
} else {
|
192
|
- String passChk = itemUnitMapper.selectItemUnitChaPass(entity.getBrandUnitUnqNo(),entity.getContSttDt());
|
|
|
|
|
194
|
+ String passChk = itemUnitMapper.selectItemUnitChaPass(entity.getBrandUnitUnqNo(), entity.getContSttDt());
|
193
|
|
195
|
|
194
|
if ("N".equals(passChk)) {
|
196
|
if ("N".equals(passChk)) {
|
195
|
// 시작일은 변경 불가
|
197
|
// 시작일은 변경 불가
|
|
@@ -217,7 +219,7 @@ public class ItemUnitService extends CommonService {
|
217
|
/*
|
219
|
/*
|
218
|
브랜드 매장 단가 리스트 조회
|
220
|
브랜드 매장 단가 리스트 조회
|
219
|
*/
|
221
|
*/
|
220
|
- public GridResponse selectStoreItemUnitGridList(String userId, String sBrandId, String sStoreId, String sStoreNm, GridRequest gridRequest) throws Exception {
|
|
|
|
|
222
|
+ public GridResponse selectStoreItemUnitGridList(String userId, String sBrandId, String sStoreId, String sStoreNm, GridRequest gridRequest) throws Exception {
|
221
|
int gridPage = gridRequest.getGridPage();
|
223
|
int gridPage = gridRequest.getGridPage();
|
222
|
int gridSize = gridRequest.getGridSize();
|
224
|
int gridSize = gridRequest.getGridSize();
|
223
|
|
225
|
|
|
@@ -235,7 +237,7 @@ public class ItemUnitService extends CommonService {
|
235
|
}
|
237
|
}
|
236
|
|
238
|
|
237
|
|
239
|
|
238
|
- int gridRecords = storeItemUnitMapper.selectStoreItemUnitGridCnt( sBrandId, sStoreId, sStoreNm );
|
|
|
|
|
240
|
+ int gridRecords = storeItemUnitMapper.selectStoreItemUnitGridCnt(sBrandId, sStoreId, sStoreNm);
|
239
|
int gridTotal = fnCalculateGridTotal(gridSize, gridRecords);
|
241
|
int gridTotal = fnCalculateGridTotal(gridSize, gridRecords);
|
240
|
List<StoreItemUnitEntity> entities = storeItemUnitMapper.selectStoreItemUnitGridList(sBrandId, sStoreId, sStoreNm, gridRequest);
|
242
|
List<StoreItemUnitEntity> entities = storeItemUnitMapper.selectStoreItemUnitGridList(sBrandId, sStoreId, sStoreNm, gridRequest);
|
241
|
List<Object> gridRows = entities.stream()
|
243
|
List<Object> gridRows = entities.stream()
|
|
@@ -287,7 +289,7 @@ public class ItemUnitService extends CommonService {
|
287
|
/* 매장 단가 정보 */
|
289
|
/* 매장 단가 정보 */
|
288
|
public StoreItemUnitInfoResponse selectStoreNewItemUnitInfo(String brandId) throws Exception {
|
290
|
public StoreItemUnitInfoResponse selectStoreNewItemUnitInfo(String brandId) throws Exception {
|
289
|
|
291
|
|
290
|
- List<StoreItemUnitEntity> entities = storeItemUnitMapper.selectStoreNewItemUnitInfo( brandId);
|
|
|
|
|
292
|
+ List<StoreItemUnitEntity> entities = storeItemUnitMapper.selectStoreNewItemUnitInfo(brandId);
|
291
|
return StoreItemUnitInfoResponse.toDTO(entities);
|
293
|
return StoreItemUnitInfoResponse.toDTO(entities);
|
292
|
|
294
|
|
293
|
}
|
295
|
}
|
|
@@ -310,31 +312,29 @@ public class ItemUnitService extends CommonService {
|
310
|
}
|
312
|
}
|
311
|
|
313
|
|
312
|
|
314
|
|
313
|
- String brandId = storeItemUnitInfolRequest.getBrandId();
|
|
|
314
|
- String storeId = storeItemUnitInfolRequest.getStoreId();
|
|
|
|
|
315
|
+ String brandId = storeItemUnitInfolRequest.getBrandId();
|
|
|
316
|
+ String storeId = storeItemUnitInfolRequest.getStoreId();
|
315
|
String contSttDt = storeItemUnitInfolRequest.getContSttDt();
|
317
|
String contSttDt = storeItemUnitInfolRequest.getContSttDt();
|
316
|
String contEndDt = storeItemUnitInfolRequest.getContEndDt();
|
318
|
String contEndDt = storeItemUnitInfolRequest.getContEndDt();
|
317
|
|
319
|
|
318
|
contSttDt = contSttDt == null ? null : contSttDt.replace(".", "");
|
320
|
contSttDt = contSttDt == null ? null : contSttDt.replace(".", "");
|
319
|
contEndDt = contEndDt == null ? null : contEndDt.replace(".", "");
|
321
|
contEndDt = contEndDt == null ? null : contEndDt.replace(".", "");
|
320
|
|
322
|
|
321
|
- List<StoreItemUnitEntity> entities = storeItemUnitMapper.selectStoreItemUnitInfo( brandId, storeId, contSttDt, contEndDt);
|
|
|
|
|
323
|
+ List<StoreItemUnitEntity> entities = storeItemUnitMapper.selectStoreItemUnitInfo(brandId, storeId, contSttDt, contEndDt);
|
322
|
return StoreItemUnitInfoResponse.toDTO(entities);
|
324
|
return StoreItemUnitInfoResponse.toDTO(entities);
|
323
|
|
325
|
|
324
|
}
|
326
|
}
|
325
|
|
327
|
|
326
|
-
|
|
|
327
|
/* 매장 단가 저장 */
|
328
|
/* 매장 단가 저장 */
|
328
|
@Transactional
|
329
|
@Transactional
|
329
|
public void saveStroeItemUnitInfo(String userId, SaveStoreItemUnitInfolRequest saveStoreItemUnitInfolRequest) throws Exception {
|
330
|
public void saveStroeItemUnitInfo(String userId, SaveStoreItemUnitInfolRequest saveStoreItemUnitInfolRequest) throws Exception {
|
330
|
try {
|
331
|
try {
|
331
|
-
|
|
|
332
|
StoreItemUnitEntity entity = new StoreItemUnitEntity();
|
332
|
StoreItemUnitEntity entity = new StoreItemUnitEntity();
|
333
|
entity.setBrandId(saveStoreItemUnitInfolRequest.getBrandId());
|
333
|
entity.setBrandId(saveStoreItemUnitInfolRequest.getBrandId());
|
334
|
entity.setStoreId(saveStoreItemUnitInfolRequest.getStoreId());
|
334
|
entity.setStoreId(saveStoreItemUnitInfolRequest.getStoreId());
|
335
|
|
335
|
|
336
|
- entity.setContSttDt(saveStoreItemUnitInfolRequest.getContSttDt().replaceAll("\\.",""));
|
|
|
337
|
- entity.setContEndDt(saveStoreItemUnitInfolRequest.getContEndDt().replaceAll("\\.",""));
|
|
|
|
|
336
|
+ entity.setContSttDt(saveStoreItemUnitInfolRequest.getContSttDt().replaceAll("\\.", ""));
|
|
|
337
|
+ entity.setContEndDt(saveStoreItemUnitInfolRequest.getContEndDt().replaceAll("\\.", ""));
|
338
|
|
338
|
|
339
|
//신규
|
339
|
//신규
|
340
|
// 종료일짜 변경 여부 확인
|
340
|
// 종료일짜 변경 여부 확인
|
|
@@ -350,23 +350,22 @@ public class ItemUnitService extends CommonService {
|
350
|
List<StoreItemUnitEntity> gridUpdateData = saveStoreItemUnitInfolRequest.toCodeEntities(saveStoreItemUnitInfolRequest.getGridUpdateData());
|
350
|
List<StoreItemUnitEntity> gridUpdateData = saveStoreItemUnitInfolRequest.toCodeEntities(saveStoreItemUnitInfolRequest.getGridUpdateData());
|
351
|
List<StoreItemUnitEntity> gridInsertData = saveStoreItemUnitInfolRequest.toCodeEntities(saveStoreItemUnitInfolRequest.getGridInsertData());
|
351
|
List<StoreItemUnitEntity> gridInsertData = saveStoreItemUnitInfolRequest.toCodeEntities(saveStoreItemUnitInfolRequest.getGridInsertData());
|
352
|
|
352
|
|
353
|
-
|
|
|
354
|
if (gridInsertData.size() > 0) {
|
353
|
if (gridInsertData.size() > 0) {
|
355
|
for (int k = 0; k < gridInsertData.size(); k++) {
|
354
|
for (int k = 0; k < gridInsertData.size(); k++) {
|
356
|
if ("C".toString().equals(saveStoreItemUnitInfolRequest.getViewCd())) {
|
355
|
if ("C".toString().equals(saveStoreItemUnitInfolRequest.getViewCd())) {
|
357
|
gridInsertData.get(k).setContSttDt(entity.getContSttDt());
|
356
|
gridInsertData.get(k).setContSttDt(entity.getContSttDt());
|
358
|
gridInsertData.get(k).setContEndDt(entity.getContEndDt());
|
357
|
gridInsertData.get(k).setContEndDt(entity.getContEndDt());
|
359
|
} else {
|
358
|
} else {
|
360
|
- gridInsertData.get(k).setContSttDt(gridInsertData.get(k).getContSttDt().replaceAll("\\.",""));
|
|
|
361
|
- gridInsertData.get(k).setContEndDt(gridInsertData.get(k).getContEndDt().replaceAll("\\.",""));
|
|
|
|
|
359
|
+ gridInsertData.get(k).setContSttDt(gridInsertData.get(k).getContSttDt().replaceAll("\\.", ""));
|
|
|
360
|
+ gridInsertData.get(k).setContEndDt(gridInsertData.get(k).getContEndDt().replaceAll("\\.", ""));
|
362
|
}
|
361
|
}
|
363
|
}
|
362
|
}
|
364
|
}
|
363
|
}
|
365
|
|
364
|
|
366
|
if (gridUpdateData.size() > 0) {
|
365
|
if (gridUpdateData.size() > 0) {
|
367
|
for (int k = 0; k < gridUpdateData.size(); k++) {
|
366
|
for (int k = 0; k < gridUpdateData.size(); k++) {
|
368
|
- gridUpdateData.get(k).setContSttDt(gridUpdateData.get(k).getContSttDt().replaceAll("\\.",""));
|
|
|
369
|
- gridUpdateData.get(k).setContEndDt(gridUpdateData.get(k).getContEndDt().replaceAll("\\.",""));
|
|
|
|
|
367
|
+ gridUpdateData.get(k).setContSttDt(gridUpdateData.get(k).getContSttDt().replaceAll("\\.", ""));
|
|
|
368
|
+ gridUpdateData.get(k).setContEndDt(gridUpdateData.get(k).getContEndDt().replaceAll("\\.", ""));
|
370
|
}
|
369
|
}
|
371
|
}
|
370
|
}
|
372
|
|
371
|
|
|
@@ -383,11 +382,8 @@ public class ItemUnitService extends CommonService {
|
383
|
|
382
|
|
384
|
StoreItemUnitEntity dtEntity = storeItemUnitMapper.selectStoreItemUnitContDtInfo(entity.getBrandId(), entity.getStoreId());
|
383
|
StoreItemUnitEntity dtEntity = storeItemUnitMapper.selectStoreItemUnitContDtInfo(entity.getBrandId(), entity.getStoreId());
|
385
|
|
384
|
|
386
|
-
|
|
|
387
|
if (dtEntity.getContSttDt() != null && !dtEntity.getContSttDt().equals("")) {
|
385
|
if (dtEntity.getContSttDt() != null && !dtEntity.getContSttDt().equals("")) {
|
388
|
// 서로 상이하면 기존 종료일자는 전송시작일보다 클경우 오류
|
386
|
// 서로 상이하면 기존 종료일자는 전송시작일보다 클경우 오류
|
389
|
-
|
|
|
390
|
-
|
|
|
391
|
// 문자열 -> Date
|
387
|
// 문자열 -> Date
|
392
|
Date dtEnddate = formatter.parse(dtEntity.getContEndDt());
|
388
|
Date dtEnddate = formatter.parse(dtEntity.getContEndDt());
|
393
|
Date sttdate = formatter.parse(entity.getContSttDt());
|
389
|
Date sttdate = formatter.parse(entity.getContSttDt());
|
|
@@ -401,26 +397,26 @@ public class ItemUnitService extends CommonService {
|
401
|
}
|
397
|
}
|
402
|
|
398
|
|
403
|
if (gridInsertData.size() > 0) {
|
399
|
if (gridInsertData.size() > 0) {
|
404
|
- storeItemUnitMapper.insertStoreItemUnitInfo(userId, entity.getBrandId(), entity.getStoreId(), entity.getContSttDt(),entity.getContEndDt(), gridInsertData) ;
|
|
|
|
|
400
|
+ storeItemUnitMapper.insertStoreItemUnitInfo(userId, entity.getBrandId(), entity.getStoreId(), entity.getContSttDt(), entity.getContEndDt(), gridInsertData);
|
405
|
}
|
401
|
}
|
406
|
|
402
|
|
407
|
if (gridUpdateData.size() > 0) {
|
403
|
if (gridUpdateData.size() > 0) {
|
408
|
-
|
|
|
409
|
- storeItemUnitMapper.updateStoreItemUnitInfo(userId, entity.getBrandId(), entity.getStoreId(), entity.getContSttDt(),entity.getContEndDt(), gridUpdateData) ;
|
|
|
|
|
404
|
+ storeItemUnitMapper.updateStoreItemUnitInfo(userId, entity.getBrandId(), entity.getStoreId(), entity.getContSttDt(), entity.getContEndDt(), gridUpdateData);
|
410
|
}
|
405
|
}
|
411
|
|
406
|
|
412
|
-
|
|
|
413
|
// 수정에 대해 날짜 변동시 전체 변동처리함
|
407
|
// 수정에 대해 날짜 변동시 전체 변동처리함
|
414
|
if ("Y".toString().equals(chgEndDtYn)) {
|
408
|
if ("Y".toString().equals(chgEndDtYn)) {
|
415
|
- storeItemUnitMapper.updateStoreItemUnitChgContEnd(entity.getBrandId(), entity.getStoreId(), entity.getContSttDt(), entity.getContEndDt() );
|
|
|
|
|
409
|
+ storeItemUnitMapper.updateStoreItemUnitChgContEnd(entity.getBrandId(), entity.getStoreId(), entity.getContSttDt(), entity.getContEndDt());
|
416
|
}
|
410
|
}
|
417
|
|
411
|
|
418
|
//selectStoreItemUnitEndDtInfo , updateStoreItemUnitChgContEnd
|
412
|
//selectStoreItemUnitEndDtInfo , updateStoreItemUnitChgContEnd
|
|
|
413
|
+
|
|
|
414
|
+ // TODO 오더퀸 연동
|
|
|
415
|
+
|
419
|
} catch (GlobalException e) {
|
416
|
} catch (GlobalException e) {
|
420
|
e.getStackTrace();
|
417
|
e.getStackTrace();
|
421
|
throw new GlobalException(e.getSystemMessageCode());
|
418
|
throw new GlobalException(e.getSystemMessageCode());
|
422
|
} catch (Exception e) {
|
419
|
} catch (Exception e) {
|
423
|
-// e.getStackTrace();
|
|
|
424
|
e.printStackTrace();
|
420
|
e.printStackTrace();
|
425
|
throw new RuntimeException();
|
421
|
throw new RuntimeException();
|
426
|
}
|
422
|
}
|