|
@@ -235,7 +235,56 @@ public class BrandService extends CommonService {
|
235
|
235
|
*/
|
236
|
236
|
} else if ("U".equals(saveBrandInfolRequest.getViewCd())) {
|
237
|
237
|
brandMapper.updateBrandInfo(userId, entity);
|
|
238
|
+ //브랜드에 사용중인 pg정보 가져오기
|
|
239
|
+ List<BrandEntity> usePgList = brandMapper.selectPgMallIdList(saveBrandInfolRequest.getBrandId());
|
|
240
|
+
|
|
241
|
+ int extPgMallCnt = 0 ;
|
|
242
|
+ int chgMallCnt = 0 ;
|
|
243
|
+ String preUseMallId = "";
|
|
244
|
+
|
|
245
|
+ if (usePgList.size() > 0 ) {
|
|
246
|
+ for (int i = 0 ; i < usePgList.size() ; i++) {
|
|
247
|
+ BrandEntity tmpPg = usePgList.get(i);
|
|
248
|
+ if ("Y".toString().equals(tmpPg.getUseYn())) {
|
|
249
|
+ preUseMallId = tmpPg.getMallId();
|
|
250
|
+ }
|
|
251
|
+
|
|
252
|
+ //동일한 pg존재 여부 확인
|
|
253
|
+ if (saveBrandInfolRequest.getPgAfflId().equals(tmpPg.getMallId())) {
|
|
254
|
+ extPgMallCnt = 1;
|
|
255
|
+ if ("N".toString().equals(tmpPg.getUseYn())) {
|
|
256
|
+ chgMallCnt = 1;
|
|
257
|
+ }
|
|
258
|
+ }
|
|
259
|
+ }
|
|
260
|
+
|
|
261
|
+ if (extPgMallCnt == 0 ) {
|
|
262
|
+ // 기존거는 삭제 하고 신규로 등록
|
|
263
|
+ //기존거 삭제
|
|
264
|
+ brandMapper.updatePgKiccBaseInfo(userId, saveBrandInfolRequest.getBrandId(), preUseMallId, "N") ;
|
|
265
|
+ //신규등록
|
|
266
|
+ PgKiccBaseInfoEntity pgInfoEntity = new PgKiccBaseInfoEntity();
|
|
267
|
+ pgInfoEntity.setBrandId(saveBrandInfolRequest.getBrandId());
|
|
268
|
+ pgInfoEntity.setMallId(saveBrandInfolRequest.getPgAfflId());
|
|
269
|
+ pgInfoEntity.setUseYn("Y");
|
|
270
|
+ brandMapper.insertPgKiccBaseInfo(userId, pgInfoEntity);
|
|
271
|
+ } else {
|
|
272
|
+ if (chgMallCnt > 0 ) {
|
|
273
|
+ // 기존 사용건은 N으로 하고 N인것을 Y로 변경한다.
|
|
274
|
+ brandMapper.updatePgKiccBaseInfo(userId, saveBrandInfolRequest.getBrandId(), preUseMallId, "N") ;
|
|
275
|
+ brandMapper.updatePgKiccBaseInfo(userId, saveBrandInfolRequest.getBrandId(), saveBrandInfolRequest.getPgAfflId(), "Y") ;
|
|
276
|
+ }
|
|
277
|
+ }
|
238
|
278
|
|
|
279
|
+ } else {
|
|
280
|
+ PgKiccBaseInfoEntity pgInfoEntity = new PgKiccBaseInfoEntity();
|
|
281
|
+ pgInfoEntity.setBrandId(saveBrandInfolRequest.getBrandId());
|
|
282
|
+ pgInfoEntity.setMallId(saveBrandInfolRequest.getPgAfflId());
|
|
283
|
+ pgInfoEntity.setUseYn("Y");
|
|
284
|
+ brandMapper.insertPgKiccBaseInfo(userId, pgInfoEntity);
|
|
285
|
+ }
|
|
286
|
+
|
|
287
|
+/*
|
239
|
288
|
String mallId = brandMapper.selectPgMallId(saveBrandInfolRequest.getBrandId());
|
240
|
289
|
|
241
|
290
|
if (mallId == null || "".equals(mallId)) {
|
|
@@ -260,7 +309,7 @@ public class BrandService extends CommonService {
|
260
|
309
|
}
|
261
|
310
|
}
|
262
|
311
|
|
263
|
|
-
|
|
312
|
+*/
|
264
|
313
|
UserMngEntity userUEntity = new UserMngEntity();
|
265
|
314
|
userUEntity.setUserId(entity.getBrandId());
|
266
|
315
|
userUEntity.setTelNo(entity.getTelNo());
|