|
@@ -279,12 +279,16 @@ public class ItemUnitService extends CommonService {
|
279
|
279
|
entity.setStoreId(saveStoreItemUnitInfolRequest.getStoreId());
|
280
|
280
|
|
281
|
281
|
List<StoreItemUnitEntity> gridUpdateData = saveStoreItemUnitInfolRequest.toCodeEntities(saveStoreItemUnitInfolRequest.getGridUpdateData());
|
|
282
|
+ List<StoreItemUnitEntity> gridInsertData = saveStoreItemUnitInfolRequest.toCodeEntities(saveStoreItemUnitInfolRequest.getGridInsertData());
|
|
283
|
+
|
|
284
|
+ String contSttDt = "";
|
|
285
|
+ String contEndDt = "";
|
282
|
286
|
|
283
|
287
|
if (gridUpdateData.size() > 0) {
|
284
|
288
|
for (int k = 0; k < gridUpdateData.size(); k++) {
|
285
|
289
|
|
286
|
|
- String contSttDt = gridUpdateData.get(k).getContSttDt().replaceAll("\\.", "");
|
287
|
|
- String contEndDt = gridUpdateData.get(k).getContEndDt().replaceAll("\\.", "");
|
|
290
|
+ contSttDt = gridUpdateData.get(k).getContSttDt().replaceAll("\\.", "");
|
|
291
|
+ contEndDt = gridUpdateData.get(k).getContEndDt().replaceAll("\\.", "");
|
288
|
292
|
gridUpdateData.get(k).setContSttDt(contSttDt);
|
289
|
293
|
gridUpdateData.get(k).setContEndDt(contEndDt);
|
290
|
294
|
|
|
@@ -293,6 +297,19 @@ public class ItemUnitService extends CommonService {
|
293
|
297
|
}
|
294
|
298
|
}
|
295
|
299
|
|
|
300
|
+ if (gridInsertData.size() > 0) {
|
|
301
|
+ for (int k = 0; k < gridInsertData.size(); k++) {
|
|
302
|
+
|
|
303
|
+ contSttDt = gridInsertData.get(k).getContSttDt().replaceAll("\\.", "");
|
|
304
|
+ contEndDt = gridInsertData.get(k).getContEndDt().replaceAll("\\.", "");
|
|
305
|
+ gridInsertData.get(k).setContSttDt(contSttDt);
|
|
306
|
+ gridInsertData.get(k).setContEndDt(contEndDt);
|
|
307
|
+
|
|
308
|
+ entity.setContSttDt(contSttDt);
|
|
309
|
+ entity.setContEndDt(contEndDt);
|
|
310
|
+ }
|
|
311
|
+ }
|
|
312
|
+
|
296
|
313
|
|
297
|
314
|
// 동일 단가계약일자 존재시
|
298
|
315
|
String rcontEndDt = "";
|
|
@@ -306,16 +323,13 @@ public class ItemUnitService extends CommonService {
|
306
|
323
|
}
|
307
|
324
|
}
|
308
|
325
|
|
|
326
|
+ if (gridInsertData.size() > 0) {
|
|
327
|
+ storeItemUnitMapper.insertStoreItemUnitInfo(userId, entity.getBrandId(), entity.getStoreId(), entity.getContSttDt(),entity.getContEndDt(), gridInsertData) ;
|
|
328
|
+ }
|
309
|
329
|
|
310
|
330
|
if (gridUpdateData.size() > 0) {
|
311
|
331
|
|
312
|
|
- if (!"".equals(rcontEndDt)) {
|
313
|
|
- for (int i = 0; i < gridUpdateData.size(); i++) {
|
314
|
|
- gridUpdateData.get(i).setStoreUnitUnqNo("");
|
315
|
|
- }
|
316
|
|
- }
|
317
|
|
-
|
318
|
|
- storeItemUnitMapper.insertMergStoreItemUnitInfo(userId, entity.getBrandId(), entity.getStoreId(), entity.getContSttDt(),entity.getContEndDt(), gridUpdateData) ;
|
|
332
|
+ storeItemUnitMapper.updateStoreItemUnitInfo(userId, entity.getBrandId(), entity.getStoreId(), entity.getContSttDt(),entity.getContEndDt(), gridUpdateData) ;
|
319
|
333
|
}
|
320
|
334
|
|
321
|
335
|
} catch (GlobalException e) {
|