|
@@ -6,6 +6,7 @@ import com.oqpo.api.entity.oper.UserMngEntity;
|
6
|
6
|
import com.oqpo.api.entity.stinfo.StoreBaseInfoEntity;
|
7
|
7
|
import com.oqpo.api.entity.stockmng.WhsMgntBaseInfoEntity;
|
8
|
8
|
import com.oqpo.api.entity.stockmng.WhsMgntBaseLocEntity;
|
|
9
|
+import com.oqpo.api.enums.IfCode;
|
9
|
10
|
import com.oqpo.api.exception.GlobalException;
|
10
|
11
|
import com.oqpo.api.mapper.loan.LoanMgntMapper;
|
11
|
12
|
import com.oqpo.api.mapper.oper.UserMngMapper;
|
|
@@ -14,9 +15,11 @@ import com.oqpo.api.mapper.stinfo.StoreBaseInfoMapper;
|
14
|
15
|
import com.oqpo.api.service.CommonService;
|
15
|
16
|
import com.oqpo.api.service.stockmng.WhsMngService;
|
16
|
17
|
import com.oqpo.api.web.dto.request.GridRequest;
|
|
18
|
+import com.oqpo.api.web.dto.request.ifmng.BoStoreChgInfoRequest;
|
17
|
19
|
import com.oqpo.api.web.dto.request.stinfo.store.SaveStoreInfolRequest;
|
18
|
20
|
import com.oqpo.api.web.dto.request.stockmng.SaveWhsInfoRequest;
|
19
|
21
|
import com.oqpo.api.web.dto.response.GridResponse;
|
|
22
|
+import com.oqpo.api.web.dto.response.ifmng.BoStoreChgInfoResponse;
|
20
|
23
|
import com.oqpo.api.web.dto.response.stinfo.store.StoreInfoResponse;
|
21
|
24
|
import com.oqpo.api.web.dto.response.stinfo.store.StorePopSearchResponse;
|
22
|
25
|
import com.oqpo.api.web.dto.response.stinfo.store.StoreSearchListResponse;
|
|
@@ -419,4 +422,145 @@ public class StoreBaseInfoService extends CommonService {
|
419
|
422
|
}
|
420
|
423
|
}
|
421
|
424
|
|
|
425
|
+
|
|
426
|
+ /*
|
|
427
|
+ 오피스 매장변경 정보 수신
|
|
428
|
+ */
|
|
429
|
+ @Transactional
|
|
430
|
+ public BoStoreChgInfoResponse ifBoSaveChgStore(String userId, BoStoreChgInfoRequest boStoreChgInfoRequest) throws Exception {
|
|
431
|
+ // 매장 변경정보 저장
|
|
432
|
+ try {
|
|
433
|
+ StoreBaseInfoEntity storeChgInfo = new StoreBaseInfoEntity();
|
|
434
|
+
|
|
435
|
+ StoreBaseInfoEntity oldStoreInfo = storeBaseInfoMapper.selectStoreInfo(boStoreChgInfoRequest.getBrandId(), boStoreChgInfoRequest.getStoreId()) ;
|
|
436
|
+
|
|
437
|
+ if ("1".toString().equals(boStoreChgInfoRequest.getStoreType())) {
|
|
438
|
+ storeChgInfo.setStoreDvsn("S01");
|
|
439
|
+ } else if ("2".toString().equals(boStoreChgInfoRequest.getStoreType())) {
|
|
440
|
+ storeChgInfo.setStoreDvsn("S02");
|
|
441
|
+ } else if ("3".toString().equals(boStoreChgInfoRequest.getStoreType())) {
|
|
442
|
+ storeChgInfo.setStoreDvsn("S03");
|
|
443
|
+ }
|
|
444
|
+ String chgStatus = "N"; // Y 사용으로 변경
|
|
445
|
+
|
|
446
|
+
|
|
447
|
+ if ("1".toString().equals(boStoreChgInfoRequest.getStoreStatus())) {
|
|
448
|
+ if ("ST02".equals(oldStoreInfo.getStoreStCd())) {
|
|
449
|
+ storeChgInfo.setStoreStCd("ST01");
|
|
450
|
+ chgStatus = "Y";
|
|
451
|
+ } else if ("ST03".equals(oldStoreInfo.getStoreStCd())) {
|
|
452
|
+ storeChgInfo.setStoreStCd("ST01");
|
|
453
|
+ chgStatus = "Y";
|
|
454
|
+ } else {
|
|
455
|
+ storeChgInfo.setStoreStCd("ST01");
|
|
456
|
+ chgStatus = "N"; // 수정안함
|
|
457
|
+ }
|
|
458
|
+ } else if ("2".toString().equals(boStoreChgInfoRequest.getStoreStatus())) {
|
|
459
|
+ if ("ST01".equals(oldStoreInfo.getStoreStCd())) {
|
|
460
|
+ storeChgInfo.setStoreStCd("ST02");
|
|
461
|
+ chgStatus = "Y";
|
|
462
|
+ // 사용자상태값만 보류처리
|
|
463
|
+ } else if ("ST03".equals(oldStoreInfo.getStoreStCd())) {
|
|
464
|
+ storeChgInfo.setStoreStCd("ST02");
|
|
465
|
+ chgStatus = "Y";
|
|
466
|
+ // 사용자상태값은 보류처리
|
|
467
|
+ } else {
|
|
468
|
+ storeChgInfo.setStoreStCd("ST02");
|
|
469
|
+ chgStatus = "N"; // 수정안함
|
|
470
|
+ // 수정안함
|
|
471
|
+ }
|
|
472
|
+ } else if ("9".toString().equals(boStoreChgInfoRequest.getStoreStatus())) {
|
|
473
|
+ if ("ST01".equals(oldStoreInfo.getStoreStCd())) {
|
|
474
|
+ storeChgInfo.setStoreStCd("ST03");
|
|
475
|
+ chgStatus = "Y";
|
|
476
|
+ // 사용자상태값만 보류처리
|
|
477
|
+ } else if ("ST02".equals(oldStoreInfo.getStoreStCd())) {
|
|
478
|
+ storeChgInfo.setStoreStCd("ST03");
|
|
479
|
+ chgStatus = "Y";
|
|
480
|
+ // 사용자상태값은 보류처리
|
|
481
|
+ } else {
|
|
482
|
+ storeChgInfo.setStoreStCd("ST03");
|
|
483
|
+ chgStatus = "N";
|
|
484
|
+ // 수정안함
|
|
485
|
+ }
|
|
486
|
+ }
|
|
487
|
+
|
|
488
|
+ storeChgInfo.setStoreNm(boStoreChgInfoRequest.getStoreNm() );
|
|
489
|
+ storeChgInfo.setBsnsRegNo(boStoreChgInfoRequest.getBizNo() );
|
|
490
|
+ storeChgInfo.setBsnsCndt(boStoreChgInfoRequest.getBizCat() );
|
|
491
|
+ storeChgInfo.setCtgrBsns(boStoreChgInfoRequest.getBizCon() );
|
|
492
|
+ storeChgInfo.setOwnerNm(boStoreChgInfoRequest.getOwnerNm() );
|
|
493
|
+ storeChgInfo.setTelNo(boStoreChgInfoRequest.getTel().replaceAll("\\-",""));
|
|
494
|
+ storeChgInfo.setMblNo(boStoreChgInfoRequest.getCell().replaceAll("\\-",""));
|
|
495
|
+ storeChgInfo.setFaxNo(boStoreChgInfoRequest.getFax().replaceAll("\\-",""));
|
|
496
|
+ storeChgInfo.setEmalAddr(boStoreChgInfoRequest.getEmail() );
|
|
497
|
+ storeChgInfo.setZipNo(boStoreChgInfoRequest.getZipNo() );
|
|
498
|
+ storeChgInfo.setAddr1(boStoreChgInfoRequest.getAddr1() );
|
|
499
|
+ storeChgInfo.setAddr2(boStoreChgInfoRequest.getAddr2() );
|
|
500
|
+ storeChgInfo.setAreaCd(boStoreChgInfoRequest.getAreaCd() );
|
|
501
|
+ storeChgInfo.setOpenDt(boStoreChgInfoRequest.getOpenDate().replaceAll("\\.",""));
|
|
502
|
+ if (boStoreChgInfoRequest.getCloseDate() != null && !"".equals(boStoreChgInfoRequest.getCloseDate())) {
|
|
503
|
+ storeChgInfo.setCloseDt(boStoreChgInfoRequest.getCloseDate().replaceAll("\\.",""));
|
|
504
|
+ } else {
|
|
505
|
+ storeChgInfo.setCloseDt(null);
|
|
506
|
+ }
|
|
507
|
+ storeChgInfo.setDelYn("Y".toString().equals(boStoreChgInfoRequest.getUseYn()) ? "N" : "Y");
|
|
508
|
+ storeChgInfo.setOqBrandId(boStoreChgInfoRequest.getBrandCd() );
|
|
509
|
+ storeChgInfo.setOqStoreId(boStoreChgInfoRequest.getStoreNo() );
|
|
510
|
+ storeChgInfo.setBrandId(boStoreChgInfoRequest.getBrandId() );
|
|
511
|
+ storeChgInfo.setStoreId(boStoreChgInfoRequest.getStoreId() );
|
|
512
|
+
|
|
513
|
+ storeBaseInfoMapper.updateBoStoreChgInfo(userId,storeChgInfo );
|
|
514
|
+
|
|
515
|
+ if ("Y".toString().equals(chgStatus)) {
|
|
516
|
+ //사용자정보
|
|
517
|
+ UserMngEntity userUEntity = new UserMngEntity();
|
|
518
|
+ userUEntity.setUserId(storeChgInfo.getStoreId());
|
|
519
|
+ userUEntity.setTelNo(storeChgInfo.getMblNo());
|
|
520
|
+ userUEntity.setEmail(storeChgInfo.getEmalAddr());
|
|
521
|
+ userUEntity.setUserNm(storeChgInfo.getOwnerNm());
|
|
522
|
+
|
|
523
|
+ if ("ST01".equals(storeChgInfo.getStoreStCd())) {
|
|
524
|
+ userUEntity.setUserStatCd("10");
|
|
525
|
+ } else if ("ST02".equals(storeChgInfo.getStoreStCd())) {
|
|
526
|
+ userUEntity.setUserStatCd("30");
|
|
527
|
+ } else if ("ST03".equals(storeChgInfo.getStoreStCd())) {
|
|
528
|
+ userUEntity.setUserStatCd("90");
|
|
529
|
+ }
|
|
530
|
+ userMngMapper.updateUserInfo(userId, userUEntity);
|
|
531
|
+
|
|
532
|
+
|
|
533
|
+ // 창고정보 변동 처리 whs_use_yn
|
|
534
|
+ String whsStCd = "";
|
|
535
|
+ String locStCd = "";
|
|
536
|
+
|
|
537
|
+ if ("ST03".equals(storeChgInfo.getStoreStCd())) {
|
|
538
|
+ // 매장 폐점 == > 매장창고 폐점 처리함
|
|
539
|
+ whsStCd = "W003";
|
|
540
|
+ locStCd = "LOC003";
|
|
541
|
+ } else if ("ST01".equals(storeChgInfo.getStoreStCd())) {
|
|
542
|
+ whsStCd = "W001";
|
|
543
|
+ locStCd = "LOC001";
|
|
544
|
+ } else if ("ST02".equals(storeChgInfo.getStoreStCd())) {
|
|
545
|
+ whsStCd = "W002";
|
|
546
|
+ locStCd = "LOC002";
|
|
547
|
+ }
|
|
548
|
+
|
|
549
|
+ whsMngService.chgStatusStoreWhsInfo(userId, storeChgInfo.getBrandId(), storeChgInfo.getStoreId(), whsStCd, locStCd);
|
|
550
|
+
|
|
551
|
+ } //DpstStCd.DPST_REQ.getCd()
|
|
552
|
+ storeChgInfo.setCode(IfCode.S01.getCd());
|
|
553
|
+ storeChgInfo.setMessage(IfCode.S01.getName());
|
|
554
|
+
|
|
555
|
+
|
|
556
|
+ return BoStoreChgInfoResponse.toDTO(storeChgInfo);
|
|
557
|
+ } catch (GlobalException e) {
|
|
558
|
+ e.getStackTrace();
|
|
559
|
+ throw new GlobalException(e.getSystemMessageCode());
|
|
560
|
+ } catch (Exception e) {
|
|
561
|
+ e.getStackTrace();
|
|
562
|
+ throw new RuntimeException();
|
|
563
|
+ }
|
|
564
|
+ }
|
|
565
|
+
|
422
|
566
|
}
|