浏览代码

브랜드관리 부분 수정 및 기존 버그 수정

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

+ 5 - 0
src/main/java/com/oqpo/api/entity/stinfo/BrandEntity.java

@@ -15,10 +15,14 @@ public class BrandEntity implements Serializable {
15 15
     private String brandId;
16 16
     private String brandNm;
17 17
     private String stCd;
18
+    private String stNm;
18 19
     private String brandType;
20
+    private String brandTypeNm;
19 21
     private String zipNo;
20 22
     private String addr1;
21 23
     private String addr2;
24
+    private String latX;
25
+    private String longY;
22 26
     private String telNo;
23 27
     private String faxNo;
24 28
     private String regDt;
@@ -33,6 +37,7 @@ public class BrandEntity implements Serializable {
33 37
     private String brandLogoFileNo;
34 38
     private String bsnsRegNo;
35 39
     private String corpRegNo;
40
+    private String oqBrandId;
36 41
     private String sysRegDttm;
37 42
     private String sysRegId;
38 43
     private String sysChgDttm;

+ 11 - 0
src/main/java/com/oqpo/api/mapper/stinfo/BrandMapper.java

@@ -1,6 +1,7 @@
1 1
 package com.oqpo.api.mapper.stinfo;
2 2
 
3 3
 
4
+import com.oqpo.api.entity.oper.SaleMgrMgntEntity;
4 5
 import com.oqpo.api.entity.stinfo.BrandEntity;
5 6
 import com.oqpo.api.web.dto.request.GridRequest;
6 7
 import org.apache.ibatis.annotations.Mapper;
@@ -18,4 +19,14 @@ public interface BrandMapper {
18 19
 
19 20
     List<BrandEntity> selectAfflBrandList(@Param("afflShopId") String afflShopId)throws Exception;
20 21
 
22
+    List<BrandEntity> selectBrandGridList(@Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sBrandNm") String sBrandNm, @Param("sBrandType") String sBrandType , @Param("sStCd") String sStCd  , GridRequest gridRequest)throws Exception;
23
+    int selectBrandGridCnt(@Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sBrandNm") String sBrandNm, @Param("sBrandType") String sBrandType , @Param("sStCd") String sStCd )throws Exception;
24
+
25
+    BrandEntity selectBrandInfo(@Param("brandId") String brandId)throws Exception;
26
+
27
+    int insertBrandInfo(@Param("userId") String userId, BrandEntity entity) throws Exception;
28
+    int updateBrandInfo(@Param("userId") String userId, BrandEntity entity) throws Exception;
29
+
30
+    String selectBrandInitPw(@Param("brandId") String brandId )throws Exception;
31
+
21 32
 }

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

@@ -162,6 +162,7 @@ public class AfflService extends CommonService {
162 162
                 afflMapper.updateAfflShopBaseInfo(userId, entity);
163 163
 
164 164
                 UserMngEntity userUEntity = new UserMngEntity();
165
+                userUEntity.setUserId(entity.getAfflShopId());
165 166
                 userUEntity.setTelNo(entity.getRprstTelNo());
166 167
                 userUEntity.setEmail(entity.getRprstEmai());
167 168
 

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

@@ -50,7 +50,6 @@ public class SaleMgrMgnService extends CommonService {
50 50
 
51 51
         int gridRecords = saleMgrMgnMapper.selectPopSaleMgrMgnGridCnt(sSaleMgrNm);
52 52
 
53
-        System.out.println("============><========================================") ;
54 53
         int gridTotal = fnCalculateGridTotal(gridSize, gridRecords);
55 54
         List<SaleMgrMgntEntity> entities = saleMgrMgnMapper.selectPopSaleMgrMgnGridList(sSaleMgrNm, gridRequest);
56 55
         List<Object> gridRows = entities.stream()
@@ -97,7 +96,6 @@ public class SaleMgrMgnService extends CommonService {
97 96
     }
98 97
 
99 98
     /* 영업담당자 저장 */
100
-
101 99
     @Transactional
102 100
     public void saveSaleMgrMgn(String userId, SaveSaleMgrMgnlRequest saveSaleMgrMgnlRequest) throws Exception {
103 101
         try {
@@ -148,6 +146,7 @@ public class SaleMgrMgnService extends CommonService {
148 146
                 saleMgrMgnMapper.updateSaleMgrMgn(userId, entity);
149 147
 
150 148
                 UserMngEntity userUEntity = new UserMngEntity();
149
+                userUEntity.setUserId(entity.getSaleMgrId());
151 150
                 userUEntity.setTelNo(entity.getRprstTelNo());
152 151
                 userUEntity.setEmail(entity.getRprstEmai());
153 152
 
@@ -175,13 +174,15 @@ public class SaleMgrMgnService extends CommonService {
175 174
      영업담당자 아이디 중복체크
176 175
      */
177 176
     public String selectSaleMgrIdDupYn(String saleMgrId) throws Exception {
178
-        return saleMgrMgnMapper.selectSaleMgrIdDupYn(saleMgrId);
177
+        return userMngMapper.selectUserIdDupYn(saleMgrId);
178
+        //return saleMgrMgnMapper.selectSaleMgrIdDupYn(saleMgrId);
179 179
     }
180 180
 
181 181
 
182 182
     /*
183 183
   영업담당자 비번  초기화
184 184
    */
185
+    @Transactional
185 186
     public String selectSaleMgrInitPw(String userId, String saleMgrId) throws Exception {
186 187
         // 사용자 정보를 가져옴
187 188
         String initPw  = saleMgrMgnMapper.selectSaleMgrInitPw(saleMgrId);

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

@@ -143,6 +143,7 @@ public class UserMngService extends CommonService {
143 143
     /*
144 144
    사용자 pw 초기화
145 145
     */
146
+    @Transactional
146 147
     public String updateInitUserPw(String userId) throws Exception {
147 148
         // 사용자 정보를 가져옴
148 149
         UserMngEntity entity = userMngMapper.selectUserInfo(userId);
@@ -261,6 +262,7 @@ public class UserMngService extends CommonService {
261 262
     /*
262 263
    사용자 pw 변경
263 264
     */
265
+    @Transactional
264 266
     public void updateChgUserPw(String userId, String newPw) throws Exception {
265 267
         String password = passwordEncoder.encode(newPw);//aes256.aesEncode(entity.getTelNo());
266 268
         userMngMapper.updateInitUserPw(userId, password);

+ 146 - 3
src/main/java/com/oqpo/api/service/stinfo/BrandService.java

@@ -2,18 +2,27 @@ package com.oqpo.api.service.stinfo;
2 2
 
3 3
 
4 4
 
5
-import com.oqpo.api.entity.CodeEntity;
5
+import com.oqpo.api.entity.oper.SaleMgrMgntEntity;
6
+import com.oqpo.api.entity.oper.UserMngEntity;
6 7
 import com.oqpo.api.entity.stinfo.BrandEntity;
8
+import com.oqpo.api.exception.GlobalException;
9
+import com.oqpo.api.mapper.oper.UserMngMapper;
7 10
 import com.oqpo.api.mapper.stinfo.BrandMapper;
8 11
 import com.oqpo.api.service.CommonService;
9 12
 import com.oqpo.api.web.dto.request.GridRequest;
13
+import com.oqpo.api.web.dto.request.oper.salemgr.SaveSaleMgrMgnlRequest;
14
+import com.oqpo.api.web.dto.request.stinfo.brand.SaveBrandInfolRequest;
10 15
 import com.oqpo.api.web.dto.response.GridResponse;
11
-import com.oqpo.api.web.dto.response.code.CodeSearchListResponse;
12
-import com.oqpo.api.web.dto.response.stinfo.BrandSearchResponse;
16
+import com.oqpo.api.web.dto.response.oper.salemgr.SaleMgrMgnInfoResponse;
17
+import com.oqpo.api.web.dto.response.stinfo.brand.BrandInfoResponse;
18
+import com.oqpo.api.web.dto.response.stinfo.brand.BrandSearchListResponse;
19
+import com.oqpo.api.web.dto.response.stinfo.brand.BrandSearchResponse;
13 20
 import com.oqpo.api.web.dto.response.stinfo.brand.AfflBrandSearchResponse;
14 21
 import lombok.extern.slf4j.Slf4j;
15 22
 import org.springframework.beans.factory.annotation.Autowired;
23
+import org.springframework.security.crypto.password.PasswordEncoder;
16 24
 import org.springframework.stereotype.Service;
25
+import org.springframework.transaction.annotation.Transactional;
17 26
 
18 27
 import java.util.List;
19 28
 import java.util.stream.Collectors;
@@ -24,6 +33,12 @@ public class BrandService extends CommonService {
24 33
     @Autowired
25 34
     private BrandMapper brandMapper;
26 35
 
36
+    @Autowired
37
+    private PasswordEncoder passwordEncoder;
38
+
39
+    @Autowired
40
+    private UserMngMapper userMngMapper;
41
+
27 42
     /*
28 43
       session 브랜드 리스트 조회
29 44
      */
@@ -61,4 +76,132 @@ public class BrandService extends CommonService {
61 76
         return AfflBrandSearchResponse.toDTO(entities);
62 77
     }
63 78
 
79
+    /*
80
+      브랜드 그리드 리스트 조회
81
+     */
82
+    public GridResponse selectBrandGridList( String fromDt, String toDt, String sBrandNm, String sBrandType, String sStCd, GridRequest gridRequest) throws Exception {
83
+        int gridPage = gridRequest.getGridPage();
84
+        int gridSize = gridRequest.getGridSize();
85
+
86
+        fromDt = fromDt == null ? null : fromDt.replace(".", "");
87
+        toDt = toDt == null ? null : toDt.replace(".", "");
88
+
89
+        int gridRecords = brandMapper.selectBrandGridCnt( fromDt, toDt,  sBrandNm, sBrandType, sStCd);
90
+        int gridTotal = fnCalculateGridTotal(gridSize, gridRecords);
91
+        List<BrandEntity> entities = brandMapper.selectBrandGridList(fromDt, toDt,  sBrandNm, sBrandType, sStCd, gridRequest);
92
+        List<Object> gridRows = entities.stream()
93
+                .map(m -> BrandSearchListResponse.builder()
94
+                        .viewCd("R")
95
+                        .afflShopId(m.getAfflShopId())
96
+                        .afflShopNm(m.getAfflShopNm())
97
+                        .brandId(m.getBrandId())
98
+                        .brandNm(m.getBrandNm())
99
+                        .stNm(m.getStNm())
100
+                        .brandTypeNm(m.getBrandTypeNm())
101
+                        .regDt(m.getRegDt())
102
+                        .build())
103
+                .collect(Collectors.toList());
104
+        return GridResponse.toDTO(gridPage, gridTotal, gridRecords, gridRows);
105
+    }
106
+
107
+    /* 브랜드 정보 */
108
+    public BrandInfoResponse selectSaleMgrMgn(String brandId) throws Exception {
109
+        return BrandInfoResponse.toDTO(brandMapper.selectBrandInfo(brandId));
110
+    }
111
+
112
+    /* 브랜드 저장 */
113
+    @Transactional
114
+    public void saveBrandInfo(String userId, SaveBrandInfolRequest saveBrandInfolRequest) throws Exception {
115
+        try {
116
+
117
+            BrandEntity entity = new BrandEntity();
118
+            entity.setBrandId(saveBrandInfolRequest.getBrandId());
119
+            entity.setBrandNm(saveBrandInfolRequest.getBrandNm());
120
+            entity.setStCd(saveBrandInfolRequest.getStCd());
121
+            entity.setBrandType(saveBrandInfolRequest.getBrandType());
122
+            entity.setZipNo(saveBrandInfolRequest.getZipNo());
123
+            entity.setAddr1(saveBrandInfolRequest.getAddr1());
124
+            entity.setAddr2(saveBrandInfolRequest.getAddr2());
125
+            entity.setLatX(saveBrandInfolRequest.getLatX());
126
+            entity.setLongY(saveBrandInfolRequest.getLongY());
127
+            entity.setTelNo(saveBrandInfolRequest.getTelNo().replaceAll("-",""));
128
+            entity.setFaxNo(saveBrandInfolRequest.getFaxNo().replaceAll("-",""));
129
+            entity.setEmalAddr(saveBrandInfolRequest.getEmalAddr());
130
+            entity.setBnkCd(saveBrandInfolRequest.getBnkCd());
131
+            entity.setAcctNo(saveBrandInfolRequest.getAcctNo());
132
+            entity.setOwacNm(saveBrandInfolRequest.getOwacNm());
133
+            entity.setAfflShopId(saveBrandInfolRequest.getAfflShopId());
134
+            entity.setBrandLogoFileNo(saveBrandInfolRequest.getBrandLogoFileNo());
135
+            entity.setBsnsRegNo(saveBrandInfolRequest.getBsnsRegNo().replaceAll("-",""));
136
+            entity.setCorpRegNo(saveBrandInfolRequest.getCorpRegNo().replaceAll("-",""));
137
+
138
+            if ("C".equals(saveBrandInfolRequest.getViewCd())) {
139
+
140
+                // 브랜드 아이디 부여  22  entity.setContentsNo(fnGetKeyNo(17));
141
+                entity.setBrandId(fnGetKeyNo(23));  // 브랜드아이디 생성
142
+                brandMapper.insertBrandInfo(userId, entity);
143
+
144
+                //사용자 계정 정보 생성 및 권한생성
145
+                UserMngEntity userEntity = new UserMngEntity();
146
+                userEntity.setUserId(entity.getBrandId());
147
+                userEntity.setUserNm(entity.getBrandNm());
148
+                userEntity.setTelNo(entity.getTelNo());
149
+                userEntity.setEmail(entity.getEmalAddr());
150
+
151
+                if ("S000".equals(entity.getStCd())) {
152
+                    userEntity.setUserStatCd("10");
153
+                } else if ("S001".equals(entity.getStCd())) {
154
+                    userEntity.setUserStatCd("90");
155
+                } else {   //S002
156
+                    userEntity.setUserStatCd("30");
157
+                }
158
+
159
+                userEntity.setAuthTpCd("40");
160
+                //패스워드 암호화
161
+                String password = passwordEncoder.encode(entity.getBsnsRegNo().replace("-",""));
162
+                userEntity.setUserPw(password);
163
+                userMngMapper.insertUserInfo(userId, userEntity);
164
+
165
+                // 사용자 권한 등록
166
+                userMngMapper.insertUserTypeAuth(entity.getBrandId(), userId, "40");
167
+
168
+            } else if ("U".equals(saveBrandInfolRequest.getViewCd())) {
169
+                brandMapper.updateBrandInfo(userId, entity);
170
+
171
+                UserMngEntity userUEntity = new UserMngEntity();
172
+                userUEntity.setUserId(entity.getBrandId());
173
+                userUEntity.setTelNo(entity.getTelNo());
174
+                userUEntity.setEmail(entity.getEmalAddr());
175
+
176
+                if ("S000".equals(entity.getStCd())) {
177
+                    userUEntity.setUserStatCd("10");
178
+                } else if ("S001".equals(entity.getStCd())) {
179
+                    userUEntity.setUserStatCd("90");
180
+                } else {   //S002
181
+                    userUEntity.setUserStatCd("30");
182
+                }
183
+                userMngMapper.updateUserInfo(userId, userUEntity);
184
+            }
185
+
186
+        } catch (GlobalException e) {
187
+            e.getStackTrace();
188
+            throw new GlobalException(e.getSystemMessageCode());
189
+        } catch (Exception e) {
190
+            e.getStackTrace();
191
+            throw new RuntimeException();
192
+        }
193
+    }
194
+
195
+    /*
196
+  브랜드 로그인 pw 초기화
197
+   */
198
+    @Transactional
199
+    public String updateInitUserPw(String brandId) throws Exception {
200
+        // 사용자 정보를 가져옴
201
+        String initPw  = brandMapper.selectBrandInitPw(brandId);
202
+        String password = passwordEncoder.encode(initPw);
203
+        userMngMapper.updateInitUserPw(brandId, password);
204
+        return password;
205
+    }
206
+
64 207
 }

+ 84 - 0
src/main/java/com/oqpo/api/web/controller/stinfo/BrandController.java

@@ -1,10 +1,18 @@
1 1
 package com.oqpo.api.web.controller.stinfo;
2 2
 
3
+import com.oqpo.api.enums.SystemMessageCode;
3 4
 import com.oqpo.api.service.stinfo.BrandService;
5
+import com.oqpo.api.web.dto.request.oper.affl.AfflShopBaseInfoGridRequest;
6
+import com.oqpo.api.web.dto.request.oper.affl.SaveAfflRequest;
4 7
 import com.oqpo.api.web.dto.request.stinfo.brand.BrandGridRequest;
8
+import com.oqpo.api.web.dto.request.stinfo.brand.BrandSearchGridRequest;
9
+import com.oqpo.api.web.dto.request.stinfo.brand.SaveBrandInfolRequest;
5 10
 import com.oqpo.api.web.dto.response.GridResponse;
11
+import com.oqpo.api.web.dto.response.SaveResponse;
6 12
 import com.oqpo.api.web.dto.response.code.CodeSearchListResponse;
13
+import com.oqpo.api.web.dto.response.oper.affl.AfflShopInfoResponse;
7 14
 import com.oqpo.api.web.dto.response.stinfo.brand.AfflBrandSearchResponse;
15
+import com.oqpo.api.web.dto.response.stinfo.brand.BrandInfoResponse;
8 16
 import io.swagger.annotations.ApiImplicitParam;
9 17
 import io.swagger.annotations.ApiImplicitParams;
10 18
 import io.swagger.annotations.ApiOperation;
@@ -57,4 +65,80 @@ public class BrandController {
57 65
         return ResponseEntity.ok(brandService.selectAfflBrandList(afflShopId));
58 66
     }
59 67
 
68
+
69
+    /**
70
+     * 설명 : 브랜드 그리드 리스트
71
+     *
72
+     * @param brandSearchGridRequest
73
+     * @return
74
+     * @throws Exception
75
+     */
76
+
77
+    @ApiImplicitParams({
78
+            @ApiImplicitParam(name = "X-AUTH-TOKEN", value = "CONN-KEY", required = true, dataType = "String", paramType = "header")
79
+    })
80
+    @ApiOperation(value = " 브랜드 그리드 리스트")
81
+    @PostMapping("/detail-grid-list")
82
+    public ResponseEntity<GridResponse> detailGridList(@RequestBody @Valid BrandSearchGridRequest brandSearchGridRequest) throws Exception {
83
+        return ResponseEntity.ok(brandService.selectBrandGridList( brandSearchGridRequest.getFromDt(), brandSearchGridRequest.getToDt(), brandSearchGridRequest.getSBrandNm(), brandSearchGridRequest.getSBrandType(), brandSearchGridRequest.getSStCd(),  brandSearchGridRequest.toDTO(brandSearchGridRequest)));
84
+    }
85
+
86
+
87
+
88
+    /**
89
+     * 설명 : 브랜드 정보
90
+     *
91
+     * @param brandId
92
+     * @return
93
+     * @throws Exception
94
+     */
95
+    @ApiImplicitParams({
96
+            @ApiImplicitParam(name = "X-AUTH-TOKEN", value = "CONN-KEY", required = true, dataType = "String", paramType = "header"),
97
+            @ApiImplicitParam(name = "brandId", value = "브랜드번호", required = true, dataType = "String", paramType = "query")
98
+    })
99
+    @ApiOperation(value = "브랜드 정보")
100
+    @GetMapping("/info-brand")
101
+    public ResponseEntity<BrandInfoResponse> infoBrand(@RequestParam(value = "brandId") String brandId) throws Exception {
102
+        return ResponseEntity.ok(brandService.selectSaleMgrMgn(brandId));
103
+    }
104
+
105
+
106
+    /**
107
+     * 설명 : 브랜드 정보 저장
108
+     *
109
+     * @param userId
110
+     * @param SaveBrandInfolRequest
111
+     * @return SaveResponse
112
+     * @throws Exception
113
+     */
114
+    @ApiImplicitParams({
115
+            @ApiImplicitParam(name = "X-AUTH-TOKEN", value = "CONN-KEY", required = true, dataType = "String", paramType = "header")
116
+    })
117
+    @ApiOperation(value = "브랜드정보  저장")
118
+    @PostMapping("/save-brand")
119
+    public ResponseEntity<SaveResponse> saveBrand(@ApiIgnore String userId, @RequestBody @Valid SaveBrandInfolRequest saveBrandInfolRequest) throws Exception {
120
+        brandService.saveBrandInfo(userId, saveBrandInfolRequest);
121
+        return ResponseEntity.ok(SaveResponse.toDTO(SystemMessageCode.SAVE_OK));
122
+    }
123
+
124
+
125
+    /**
126
+     * 설명 : 브랜드 패스워드 초기화
127
+     *
128
+     * @param userId
129
+     * @param
130
+     * @return SaveResponse
131
+     * @throws Exception
132
+     */
133
+    @ApiImplicitParams({
134
+            @ApiImplicitParam(name = "X-AUTH-TOKEN", value = "CONN-KEY", required = true, dataType = "String", paramType = "header"),
135
+            @ApiImplicitParam(name = "brandId", value = "브랜드아이디", required = true, dataType = "String", paramType = "query")
136
+    })
137
+    @ApiOperation(value = "브랜드 패스워드 초기화")
138
+    @GetMapping("/inti-brandPw")
139
+    public ResponseEntity<SaveResponse> initBrandPw(@RequestParam(value = "brandId") String brandId) throws Exception {
140
+        brandService.updateInitUserPw(brandId);
141
+        return ResponseEntity.ok(SaveResponse.toDTO(SystemMessageCode.INIT_PW_OK));
142
+    }
143
+
60 144
 }

+ 33 - 0
src/main/java/com/oqpo/api/web/dto/request/stinfo/brand/BrandSearchGridRequest.java

@@ -0,0 +1,33 @@
1
+package com.oqpo.api.web.dto.request.stinfo.brand;
2
+
3
+import com.oqpo.api.web.dto.request.GridRequest;
4
+import io.swagger.annotations.ApiModelProperty;
5
+import lombok.Getter;
6
+import lombok.Setter;
7
+
8
+
9
+@Getter
10
+@Setter
11
+public class BrandSearchGridRequest extends GridRequest {
12
+
13
+    @ApiModelProperty(value = "시작일자")
14
+    private String fromDt;
15
+
16
+    @ApiModelProperty(value = "종료일자")
17
+    private String toDt;
18
+
19
+    @ApiModelProperty(value = "브랜드명")
20
+    private String sBrandNm;
21
+
22
+    @ApiModelProperty(value = "브랜드타입")
23
+    private String sBrandType;
24
+
25
+    @ApiModelProperty(value = "상태")
26
+    private String sStCd;
27
+
28
+
29
+
30
+    protected BrandSearchGridRequest(Integer gridSize, Integer gridPage, String sidx, String sord, Boolean pagingYn, Integer gridFirst) {
31
+        super(gridSize, gridPage, sidx, sord, pagingYn, gridFirst);
32
+    }
33
+}

+ 80 - 0
src/main/java/com/oqpo/api/web/dto/request/stinfo/brand/SaveBrandInfolRequest.java

@@ -0,0 +1,80 @@
1
+package com.oqpo.api.web.dto.request.stinfo.brand;
2
+
3
+import io.swagger.annotations.ApiModelProperty;
4
+import lombok.Getter;
5
+import lombok.Setter;
6
+
7
+import javax.validation.constraints.NotBlank;
8
+
9
+@Getter
10
+@Setter
11
+public class SaveBrandInfolRequest {
12
+    @NotBlank
13
+    @ApiModelProperty(value = "CRUD")
14
+    private String viewCd;
15
+
16
+    @ApiModelProperty(value = "브랜명아이디")
17
+    private String brandId ;
18
+
19
+    @NotBlank
20
+    @ApiModelProperty(value = "브랜드명")
21
+    private String brandNm ;
22
+
23
+    @NotBlank
24
+    @ApiModelProperty(value = "상태코드")
25
+    private String stCd ;
26
+
27
+    @ApiModelProperty(value = "브랜드타입")
28
+    private String brandType ;
29
+
30
+    @ApiModelProperty(value = "우편번호")
31
+    private String zipNo;
32
+
33
+    @ApiModelProperty(value = "주소1")
34
+    private String addr1 ;
35
+
36
+    @ApiModelProperty(value = "주소2")
37
+    private String addr2 ;
38
+
39
+    @ApiModelProperty(value = "x위도")
40
+    private String latX;
41
+
42
+    @ApiModelProperty(value = "y경도")
43
+    private String longY;
44
+
45
+    @NotBlank
46
+    @ApiModelProperty(value = "전화번호")
47
+    private String telNo ;
48
+
49
+    @ApiModelProperty(value = "팩스번호")
50
+    private String faxNo ;
51
+
52
+    @ApiModelProperty(value = "이메일")
53
+    private String emalAddr ;
54
+
55
+    @NotBlank
56
+    @ApiModelProperty(value = "은행코드")
57
+    private String bnkCd ;
58
+
59
+    @NotBlank
60
+    @ApiModelProperty(value = "은행계좌번호")
61
+    private String acctNo;
62
+
63
+    @NotBlank
64
+    @ApiModelProperty(value = "예금주명")
65
+    private String owacNm ;
66
+
67
+    @NotBlank
68
+    @ApiModelProperty(value = "가맹점아이디")
69
+    private String afflShopId ;
70
+
71
+    @ApiModelProperty(value = "브랜드로고파일번호")
72
+    private String brandLogoFileNo ;
73
+
74
+    @NotBlank
75
+    @ApiModelProperty(value = "사업자번호")
76
+    private String bsnsRegNo ;
77
+
78
+    @ApiModelProperty(value = "법인번호")
79
+    private String corpRegNo;
80
+}

+ 138 - 0
src/main/java/com/oqpo/api/web/dto/response/stinfo/brand/BrandInfoResponse.java

@@ -0,0 +1,138 @@
1
+package com.oqpo.api.web.dto.response.stinfo.brand;
2
+
3
+import com.fasterxml.jackson.annotation.JsonInclude;
4
+import com.oqpo.api.entity.oper.SaleMgrMgntEntity;
5
+import com.oqpo.api.entity.stinfo.BrandEntity;
6
+import io.swagger.annotations.ApiModelProperty;
7
+import lombok.*;
8
+
9
+
10
+@Getter
11
+@Setter
12
+@Builder
13
+@AllArgsConstructor(access = AccessLevel.PROTECTED)
14
+@JsonInclude(JsonInclude.Include.ALWAYS)
15
+public class BrandInfoResponse {
16
+
17
+    @ApiModelProperty(value = "브랜명아이디")
18
+    private String brandId ;
19
+
20
+    @ApiModelProperty(value = "브랜드명")
21
+    private String brandNm ;
22
+
23
+    @ApiModelProperty(value = "상태코드")
24
+    private String stCd ;
25
+
26
+    @ApiModelProperty(value = "싱태명")
27
+    private String stNm ;
28
+
29
+    @ApiModelProperty(value = "브랜드타입")
30
+    private String brandType ;
31
+
32
+    @ApiModelProperty(value = "브랜드타입명")
33
+    private String brandTypeNm ;
34
+
35
+    @ApiModelProperty(value = "우편번호")
36
+    private String zipNo;
37
+
38
+    @ApiModelProperty(value = "주소1")
39
+    private String addr1 ;
40
+
41
+    @ApiModelProperty(value = "주소2")
42
+    private String addr2 ;
43
+
44
+    @ApiModelProperty(value = "x위도")
45
+    private String latX;
46
+
47
+    @ApiModelProperty(value = "y경도")
48
+    private String longY;
49
+
50
+    @ApiModelProperty(value = "전화번호")
51
+    private String telNo ;
52
+
53
+    @ApiModelProperty(value = "팩스번호")
54
+    private String faxNo ;
55
+
56
+    @ApiModelProperty(value = "등록일")
57
+    private String regDt;
58
+
59
+    @ApiModelProperty(value = "등록자")
60
+    private String regId ;
61
+
62
+    @ApiModelProperty(value = "이메일")
63
+    private String emalAddr ;
64
+
65
+    @ApiModelProperty(value = "은행코드")
66
+    private String bnkCd ;
67
+
68
+    @ApiModelProperty(value = "은행명")
69
+    private String bnkCdNm ;
70
+
71
+    @ApiModelProperty(value = "은행계좌번호")
72
+    private String acctNo;
73
+
74
+    @ApiModelProperty(value = "예금주명")
75
+   private String owacNm ;
76
+
77
+    @ApiModelProperty(value = "가맹점아이디")
78
+    private String afflShopId ;
79
+
80
+    @ApiModelProperty(value = "브랜드로고파일번호")
81
+    private String brandLogoFileNo ;
82
+
83
+    @ApiModelProperty(value = "사업자번호")
84
+    private String bsnsRegNo ;
85
+
86
+    @ApiModelProperty(value = "법인번호")
87
+    private String corpRegNo;
88
+
89
+    @ApiModelProperty(value = "오더퀸브랜드아이디")
90
+    private String oqBrandId ;
91
+
92
+    @ApiModelProperty(value = "시스템등록일")
93
+    private String sysRegDttm;
94
+
95
+    @ApiModelProperty(value = "시스템등록자")
96
+    private String sysRegId;
97
+
98
+    @ApiModelProperty(value = "시스템변경일")
99
+    private String sysChgDttm;
100
+
101
+    @ApiModelProperty(value = "시스템변경자")
102
+    private String sysChgId;
103
+
104
+    public static BrandInfoResponse toDTO(BrandEntity entity) {
105
+        if (entity == null) return null;
106
+        return BrandInfoResponse.builder()
107
+                .brandId(entity.getBrandId())
108
+                .brandNm(entity.getBrandNm())
109
+                .stCd(entity.getStCd())
110
+                .stNm(entity.getStNm())
111
+                .brandType(entity.getBrandType() == null ? "" :entity.getBrandType())
112
+                .brandTypeNm(entity.getBrandTypeNm() == null ? "" :entity.getBrandTypeNm())
113
+                .zipNo(entity.getZipNo() == null ? "" :entity.getZipNo())
114
+                .addr1(entity.getAddr1() == null ? "" :entity.getAddr1())
115
+                .addr2(entity.getAddr2() == null ? "" :entity.getAddr2())
116
+                .latX(entity.getLatX() == null ? "" :entity.getLatX())
117
+                .longY(entity.getLongY() == null ? "" :entity.getLongY())
118
+                .telNo(entity.getTelNo() == null ? "" :entity.getTelNo())
119
+                .faxNo(entity.getFaxNo() == null ? "" :entity.getFaxNo())
120
+                .regDt(entity.getRegDt() == null ? "" :entity.getRegDt())
121
+                .regId(entity.getRegId() == null ? "" :entity.getRegId())
122
+                .emalAddr(entity.getEmalAddr() == null ? "" :entity.getEmalAddr())
123
+                .bnkCd(entity.getBnkCd() == null ? "" :entity.getBnkCd())
124
+                .bnkCdNm(entity.getBrandNm() == null ? "" :entity.getBrandNm())
125
+                .acctNo(entity.getBrandNm() == null ? "" :entity.getBrandNm())
126
+                .owacNm(entity.getOwacNm() == null ? "" :entity.getOwacNm())
127
+                .afflShopId(entity.getAfflShopId() == null ? "" :entity.getAfflShopId())
128
+                .brandLogoFileNo(entity.getBrandLogoFileNo() == null ? "" :entity.getBrandLogoFileNo())
129
+                .bsnsRegNo(entity.getBsnsRegNo() == null ? "" :entity.getBsnsRegNo())
130
+                .corpRegNo(entity.getCorpRegNo() == null ? "" :entity.getCorpRegNo())
131
+                .oqBrandId(entity.getOqBrandId() == null ? "" :entity.getOqBrandId())
132
+                .sysRegDttm(entity.getSysRegDttm())
133
+                .sysRegId(entity.getRegId())
134
+                .sysChgDttm(entity.getSysChgDttm())
135
+                .sysChgId(entity.getSysChgId())
136
+                .build();
137
+    }
138
+}

+ 38 - 0
src/main/java/com/oqpo/api/web/dto/response/stinfo/brand/BrandSearchListResponse.java

@@ -0,0 +1,38 @@
1
+package com.oqpo.api.web.dto.response.stinfo.brand;
2
+
3
+import com.fasterxml.jackson.annotation.JsonInclude;
4
+import io.swagger.annotations.ApiModelProperty;
5
+import lombok.*;
6
+
7
+@Getter
8
+@Setter
9
+@Builder
10
+@AllArgsConstructor(access = AccessLevel.PROTECTED)
11
+@JsonInclude(JsonInclude.Include.ALWAYS)
12
+public class BrandSearchListResponse {
13
+
14
+    @ApiModelProperty(value = "CRUD")
15
+    private String viewCd;
16
+
17
+    @ApiModelProperty(value = "가맹점아이디")
18
+    private String afflShopId;
19
+
20
+    @ApiModelProperty(value = "가맹점명")
21
+    private String afflShopNm;
22
+
23
+    @ApiModelProperty(value = "브랜드아이디")
24
+    private String brandId;
25
+
26
+    @ApiModelProperty(value = "브랜드명")
27
+    private String brandNm;
28
+
29
+    @ApiModelProperty(value = "등록일")
30
+    private String regDt;
31
+
32
+    @ApiModelProperty(value = "브랜드상태명")
33
+    private String stNm;
34
+
35
+    @ApiModelProperty(value = "브랜드타입")
36
+    private String brandTypeNm;
37
+
38
+}

+ 1 - 1
src/main/java/com/oqpo/api/web/dto/response/stinfo/BrandSearchResponse.java

@@ -1,4 +1,4 @@
1
-package com.oqpo.api.web.dto.response.stinfo;
1
+package com.oqpo.api.web.dto.response.stinfo.brand;
2 2
 
3 3
 import com.fasterxml.jackson.annotation.JsonInclude;
4 4
 import io.swagger.annotations.ApiModelProperty;

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

@@ -125,7 +125,7 @@
125 125
         select  /* selectAfflShopBaseIdDupYn */
126 126
                 case when count(*) <![CDATA[ > ]]> 0 then 'Y' else 'N' end as dup_yn
127 127
         from affl_shop_base_info
128
-        where affl_abbr = #{afflAbbr}
128
+        where affl_abbr in ('AFS','BRD','STR',#{afflAbbr})
129 129
     </select>
130 130
 
131 131
     <insert id="insertAfflShopBaseInfo" >

+ 1 - 0
src/main/resources/mybatis/sqlmaps/oper/UserMng.xml

@@ -78,6 +78,7 @@
78 78
         select case when count(*) <![CDATA[ > ]]> 0 then 'Y' else 'N' end as cnt /* selectUserIdDupYn */
79 79
         from np_user_info
80 80
         where user_id = #{userId}
81
+        or left(upper(#{userId}),3) in ('AFS', 'BRD','STR' )
81 82
     </select>
82 83
 
83 84
     <insert id="insertUserInfo" >

+ 119 - 0
src/main/resources/mybatis/sqlmaps/stinfo/brand.xml

@@ -83,5 +83,124 @@
83 83
         and affl_shop_id = #{afflShopId}
84 84
     </select>
85 85
 
86
+    <select id="selectBrandGridList" resultType="com.oqpo.api.entity.stinfo.BrandEntity">
87
+        select /*selectBrandGridList*/
88
+                affl.affl_shop_id, affl.affl_shop_nm, brand.brand_id, brand.brand_nm
89
+                , fn_code_nm(upper('st_cd'), brand.st_cd) as st_nm
90
+                , date_format(brand.reg_dt, '%y.%m.%d') as reg_dt
91
+                , fn_code_nm(upper('brand_type'), brand.brand_type) as brand_type_nm
92
+        from brand_base_info brand
93
+            , affl_shop_base_info affl
94
+        where 1 = 1
95
+        and brand.affl_shop_id = affl.affl_shop_id
96
+        and  brand.st_cd = 'S000'
97
+        and brand.del_yn = 'N'
98
+        and affl.del_yn = 'N'
99
+        <if test="fromDt != null and fromDt != '' and toDt != null and toDt != '' ">
100
+        and brand.reg_dt between #{fromDt} and #{toDt}
101
+        </if>
102
+        <if test="sBrandNm != null and sBrandNm != ''">
103
+        and brand.brand_nm like concat('%', #{sBrandNm}, '%')
104
+        </if>
105
+        <if test="sBrandType != null and sBrandType != ''">
106
+        and brand.brand_type = #{sBrandType}
107
+        </if>
108
+        <if test="sStCd != null and sStCd != ''">
109
+            and brand.st_cd = #{sStCd}
110
+        </if>
111
+        <choose>
112
+            <when test="gridRequest.sidx != null and gridRequest.sidx != ''">
113
+                <if test="gridRequest.sidx == 'VIEW_NUM'.toString()">
114
+                    <if test="gridRequest.sord == 'asc'.toString()">
115
+                        order by brand_nm asc
116
+                    </if>
117
+                    <if test="gridRequest.sord == 'desc'.toString()">
118
+                        order by brand_nm desc
119
+                    </if>
120
+                </if>
121
+            </when>
122
+            <otherwise>
123
+                order by brand_nm asc
124
+            </otherwise>
125
+        </choose>
126
+        <if test="gridRequest.pagingYn == true">
127
+            limit #{gridRequest.gridFirst}, #{gridRequest.gridSize}
128
+        </if>
129
+    </select>
130
+
131
+    <select id="selectBrandGridCnt" resultType="int">
132
+        select /*selectBrandGridCnt*/
133
+                count(*)
134
+        from brand_base_info
135
+        where 1 = 1
136
+        and st_cd = 'S000'
137
+        and del_yn = 'N'
138
+        <if test="fromDt != null and fromDt != '' and toDt != null and toDt != '' ">
139
+            and reg_dt between #{fromDt} and #{toDt}
140
+        </if>
141
+        <if test="sBrandType != null and sBrandType != ''">
142
+            and brand_nm like concat('%', #{sBrandType}, '%')
143
+        </if>
144
+        <if test="sBrandType != null and sBrandType != ''">
145
+            and brand_type = #{sBrandType}
146
+        </if>
147
+        <if test="sStCd != null and sStCd != ''">
148
+            and st_cd = #{sStCd}
149
+        </if>
150
+    </select>
151
+
152
+    <select id="selectBrandInfo" resultType="com.oqpo.api.entity.stinfo.BrandEntity">
153
+        select brand_id, brand_nm, st_cd, fn_code_nm(upper('st_cd'), st_cd) as st_cd_nm, brand_type, fn_code_nm(upper('brand_type'), brand_type) as brand_type_nm, zip_no
154
+                , addr1, addr2, lat_x, long_y, fn_get_telno(tel_no) as tel_no, fn_get_telno(fax_no) as fax_no, date_format(reg_dt, '%y.%m.%d') as reg_dt
155
+                , reg_id, emal_addr, del_yn, bnk_cd, fn_code_nm(upper('bnk_cd'), bnk_cd) as bnk_cd_nm, acct_no
156
+                , owac_nm, affl_shop_id, brand_logo_file_no, fn_get_regno(1, bsns_reg_no) as bsns_reg_no, fn_get_regno(2, corp_reg_no) as corp_reg_no
157
+                , oq_brand_id, sys_reg_dttm, sys_reg_id, sys_chg_dttm, sys_chg_id
158
+        from brand_base_info
159
+        where brand_id = #{brandId}
160
+    </select>
161
+
162
+    <insert id="insertBrandInfo" >
163
+        insert into brand_base_info
164
+            ( brand_id, brand_nm, st_cd, brand_type, zip_no
165
+            , addr1, addr2, tel_no, fax_no, reg_dt
166
+            , reg_id, emal_addr, del_yn, bnk_cd, acct_no
167
+            , owac_nm, affl_shop_id, brand_logo_file_no, bsns_reg_no, corp_reg_no
168
+            , oq_brand_id, sys_reg_dttm, sys_reg_id, sys_chg_dttm, sys_chg_id )
169
+        values
170
+            ( #{entity.brandId}, #{entity.brandNm}, #{entity.stCd}, #{entity.brandType}, #{entity.zipNo}
171
+            , #{entity.addr1}, #{entity.addr2}, #{entity.telNo}, #{entity.faxNo}, #{entity.regDt}
172
+            , #{userId}, #{entity.emalAddr}, 'N', #{entity.bnkCd}, #{entity.acctNo}
173
+            , #{entity.owacNm}, #{entity.afflShopId}, #{entity.brandLogoFileNo}, #{entity.bsnsRegNo}, #{entity.corpRegNo}
174
+            , #{entity.oqBrandId}, now(), #{userId}, now(), #{userId})
175
+    </insert>
176
+
177
+    <update id="updateBrandInfo">
178
+        update brand_base_info
179
+        set brand_nm = #{entity.brandNm}
180
+          , st_cd = #{entity.stCd}
181
+          , brand_type = #{entity.brandType}
182
+          , zip_no = #{entity.zipNo}
183
+          , addr1 = #{entity.addr1}
184
+          , addr2 = #{entity.addr2}
185
+          , tel_no = #{entity.telNo}
186
+          , fax_no = #{entity.faxNo}
187
+          , emal_addr = #{entity.emalAddr}
188
+          , bnk_cd = #{entity.bnkCd}
189
+          , acct_no = #{entity.acctNo}
190
+          , owac_nm = #{entity.owacNm}
191
+          , brand_logo_file_no = #{entity.brandLogoFileNo}
192
+          , bsns_reg_no = #{entity.bsnsRegNo}
193
+          , corp_reg_no = #{entity.corpRegNo}
194
+          , oq_brand_id = #{entity.oqBrandId}
195
+          , sys_chg_dttm = NOW()
196
+          , sys_chg_id = #{userId}
197
+        where brand_id = #{entity.brandId}
198
+    </update>
199
+
200
+    <select id="selectBrandInitPw" resultType="String">
201
+        select bsns_reg_no
202
+         from brand_base_info
203
+         where brand_id  = #{brandId}
204
+    </select>
86 205
 
87 206
 </mapper>