浏览代码

공지사항 세션관련 수정

dwkim 2 年之前
父节点
当前提交
c378348ef5

+ 1 - 0
src/main/java/com/oqpo/api/config/JwtTokenProvider.java

@@ -29,6 +29,7 @@ public class JwtTokenProvider { // JWT 토큰을 생성 및 검증 모듈
29 29
 
30 30
     // Jwt 토큰 생성
31 31
     public String createToken(String mId, String userNm, String systemAdminYn, String authTpCd, Boolean isLogin, String afflShopId, String brandId, String authTpNm) {
32
+
32 33
         Claims claims = Jwts.claims().setSubject(mId);
33 34
         claims.put(ApiConstants.CLAIMS_USER_NM, userNm);
34 35
         claims.put(ApiConstants.CLAIMS_SYSTEM_ADMIN_YN, systemAdminYn);

+ 1 - 0
src/main/java/com/oqpo/api/entity/oper/UserMngEntity.java

@@ -1,5 +1,6 @@
1 1
 package com.oqpo.api.entity.oper;
2 2
 
3
+import io.swagger.annotations.ApiModelProperty;
3 4
 import lombok.Getter;
4 5
 import lombok.Setter;
5 6
 import lombok.ToString;

+ 5 - 3
src/main/java/com/oqpo/api/service/SessionService.java

@@ -53,9 +53,11 @@ public class SessionService extends CommonService {
53 53
             memberEntity.setSystemAdminYn(jwtTokenProvider.getSystemAdminYn(connKey));
54 54
             memberEntity.setAuthTpCd(jwtTokenProvider.getAuthTpCd(connKey));
55 55
             memberEntity.setAuthTpNm(jwtTokenProvider.getAuthTpNm(connKey));
56
-            //memberEntity.setAfflShopId(jwtTokenProvider.getAfflShopId(connKey));
57
-            //memberEntity.setBrandId(jwtTokenProvider.getBrandId(connKey));
58
-            //memberEntity.setAuthTpNm(jwtTokenProvider.getAuthTpNm(connKey));
56
+            memberEntity.setAfflShopId(jwtTokenProvider.getAfflShopId(connKey));
57
+            memberEntity.setBrandId(jwtTokenProvider.getBrandId(connKey));
58
+            memberEntity.setAuthTpNm(jwtTokenProvider.getAuthTpNm(connKey));
59
+
60
+
59 61
 
60 62
         } catch (Exception e) {
61 63
             e.getStackTrace();

+ 1 - 0
src/main/java/com/oqpo/api/service/SigninService.java

@@ -73,6 +73,7 @@ public class SigninService implements UserDetailsService {
73 73
                     memberEntity.getBrandId(),
74 74
                     memberEntity.getAuthTpNm());
75 75
             log.debug("connKey==>>>{}", connKey);
76
+
76 77
             //로그인 이력 남기기
77 78
             userMngService.updateLoginDt(memberEntity.getUserId());
78 79
 

+ 3 - 4
src/main/java/com/oqpo/api/service/oper/NticeService.java

@@ -30,7 +30,7 @@ public class NticeService extends CommonService {
30 30
       공지 검색 리스트 조회
31 31
      */
32 32
 
33
-    public GridResponse selectNticeGridList(String afflShopId, String brandId, String authTpCd, String sAfflShopId, String sBrandId, String fromDt, String toDt, String sNticeTitl, GridRequest gridRequest) throws Exception {
33
+    public GridResponse selectNticeGridList( String afflShopId, String brandId, String authTpCd, String sAfflShopId, String sBrandId, String fromDt, String toDt, String sNticeTitl, GridRequest gridRequest) throws Exception {
34 34
         int gridPage = gridRequest.getGridPage();
35 35
         int gridSize = gridRequest.getGridSize();
36 36
 
@@ -81,7 +81,6 @@ public class NticeService extends CommonService {
81 81
             entity.setBrandChk(saveNticeRequest.getBrandChk());
82 82
             entity.setShopChk(saveNticeRequest.getShopChk());
83 83
             entity.setSupplyChk(saveNticeRequest.getSupplyChk());
84
-            log.info("=============>" + entity.getBrandId() + "==" + entity.getAfflShopId() + "==" + entity.getNticeTitl() );
85 84
             if ("C".equals(saveNticeRequest.getViewCd())) {
86 85
                 // 신규 공지번호 생성
87 86
                 entity.setNticeNo(fnGetKeyNo(6));
@@ -134,8 +133,8 @@ public class NticeService extends CommonService {
134 133
                 .map(m -> NticeTargetResponse.builder()
135 134
                         .viewCd("R")
136 135
                         .nticeNo(m.getNticeNo())
137
-                        .userId(m.getBrandId())
138
-                        .userNm(m.getBrandNm())
136
+                        .brandId(m.getBrandId())
137
+                        .brandNm(m.getBrandNm())
139 138
                         .build())
140 139
                 .collect(Collectors.toList());
141 140
         return GridResponse.toDTO(gridPage, gridTotal, gridRecords, gridRows);

+ 0 - 3
src/main/java/com/oqpo/api/service/oper/UserMngService.java

@@ -84,7 +84,6 @@ public class UserMngService extends CommonService {
84 84
     public void saveUser(String userId, SaveUserRequest saveUserRequest) throws Exception {
85 85
         try {
86 86
 
87
-            System.out.println("=====================saveUser");
88 87
             // 기본정보 저장
89 88
             UserMngEntity entity = new UserMngEntity();
90 89
             entity.setUserId(saveUserRequest.getUserId());
@@ -106,14 +105,12 @@ public class UserMngService extends CommonService {
106 105
 
107 106
             if ("C".equals(saveUserRequest.getViewCd())) {
108 107
                 //패스워드 암호화
109
-                System.out.println("=====================패스워드");
110 108
                 String password = passwordEncoder.encode(saveUserRequest.getTelNo().replace("-",""));//aes256.aesEncode(entity.getTelNo());
111 109
                 entity.setUserPw(password);
112 110
                 userMngMapper.insertUserInfo(userId, entity);
113 111
             } else if ("U".equals(saveUserRequest.getViewCd())) {
114 112
                 userMngMapper.updateUserInfo(userId, entity);
115 113
             }
116
-            System.out.println("=====================getGridInsertData");
117 114
             // 사용자 권한정보 저장
118 115
             // 신규건
119 116
             if (saveUserRequest.getGridInsertData() != null) {

+ 1 - 2
src/main/java/com/oqpo/api/web/controller/oper/NticeController.java

@@ -43,8 +43,7 @@ public class NticeController {
43 43
     })
44 44
     @ApiOperation(value = " 공지 그리드 리스트")
45 45
     @PostMapping("/detail-grid-list")
46
-    public ResponseEntity<GridResponse> detailGridList(@ApiIgnore String afflShopId,@ApiIgnore String brandId,@ApiIgnore String authTpCd,@RequestBody @Valid NticeGridRequest nticeGridRequest) throws Exception {
47
-
46
+    public ResponseEntity<GridResponse> detailGridList(@ApiIgnore String afflShopId , @ApiIgnore String brandId, @ApiIgnore String authTpCd, @RequestBody @Valid NticeGridRequest nticeGridRequest) throws Exception {
48 47
         return ResponseEntity.ok(nticeService.selectNticeGridList( afflShopId, brandId, authTpCd, nticeGridRequest.getSAfflShopId(), nticeGridRequest.getSBrandId(), nticeGridRequest.getFromDt(), nticeGridRequest.getToDt(), nticeGridRequest.getSNticeTitl(),  nticeGridRequest.toDTO(nticeGridRequest)));
49 48
     }
50 49
 

+ 3 - 3
src/main/java/com/oqpo/api/web/resolver/ArgumentResolver.java

@@ -60,9 +60,9 @@ public class ArgumentResolver implements HandlerMethodArgumentResolver {
60 60
             if (parameter.getParameterName().equals(SYSTEM_ADMIN_YN)) return tokenResponse.getSystemAdminYn();
61 61
             if (parameter.getParameterName().equals(SUPER_ADMIN_YN)) return tokenResponse.getSuperAdminYn();
62 62
             if (parameter.getParameterName().equals(AUTH_TP_CD)) return tokenResponse.getAuthTpCd();
63
-            if (parameter.getParameterName().equals(AFFL_SHOP_ID)) return tokenResponse.getAuthTpCd();
64
-            if (parameter.getParameterName().equals(BRAND_ID)) return tokenResponse.getAuthTpCd();
65
-            if (parameter.getParameterName().equals(AUTH_TP_NM)) return tokenResponse.getAuthTpCd();
63
+            if (parameter.getParameterName().equals(AFFL_SHOP_ID)) return tokenResponse.getAfflShopId();
64
+            if (parameter.getParameterName().equals(BRAND_ID)) return tokenResponse.getBrandId();
65
+            if (parameter.getParameterName().equals(AUTH_TP_NM)) return tokenResponse.getAuthTpNm();
66 66
             return tokenResponse;
67 67
         } catch(Exception e) {
68 68
             e.printStackTrace();

+ 3 - 1
src/main/resources/mybatis/sqlmaps/oper/Ntice.xml

@@ -11,7 +11,6 @@
11 11
                 when  date_format(now(),'%Y%m%d') <![CDATA[ > ]]> A.noti_ed_day then '공지종료' end as ntice_stat_nm
12 12
                 ,date_format(A.noti_st_day ,'%Y.%m.%d') as noti_st_day, date_format(A.add_dt ,'%Y.%m.%d') as add_dt
13 13
         from np_ntice A
14
-        left outer join np_ntice_target B on B.ntice_no = A.ntice_no and B.brand_id = A.brand_id
15 14
         where 1=1
16 15
         <if test="authTpCd == '30'">
17 16
          and A.affl_shop_id = #{afflShopId}
@@ -19,14 +18,17 @@
19 18
         <if test="authTpCd == '40' ">
20 19
             and A.brand_id = #{brandId}
21 20
             and A.brand_chk = 'Y'
21
+            and  (A.target_cd = 'A' or ( A.target_cd = 'T' and  (select 1 from np_ntice_target where ntice_no = A.ntice_no and brand_id = #{brandId} ) = 1  ))
22 22
         </if>
23 23
         <if test="authTpCd == '50' ">
24 24
             and A.brand_id = #{brandId}
25 25
             and A.shop_chk = 'Y'
26
+            and  (A.target_cd = 'A' or ( A.target_cd = 'T' and  (select 1 from np_ntice_target where ntice_no = A.ntice_no and brand_id = #{brandId} ) = 1  ))
26 27
         </if>
27 28
         <if test="authTpCd == '60' ">
28 29
             and A.brand_id = #{brandId}
29 30
             and A.supply_chk = 'Y'
31
+            and  (A.target_cd = 'A' or ( A.target_cd = 'T' and  (select 1 from np_ntice_target where ntice_no = A.ntice_no and brand_id = #{brandId} ) = 1  ))
30 32
         </if>
31 33
         <if test="sAfflShopId != null and sAfflShopId != ''">
32 34
             and    A.affl_shop_id = #{sAfflShopId}