์ƒˆ์†Œ์‹

๐Ÿ“šStudy/ETC

[์„ค๊ณ„] ์ฟ ํฐ ๊ธฐ๋Šฅ ํ™•์žฅํ•˜๊ธฐ

  • -

 

 

 

 

์Šค์Šค๋กœ ์•ฝ์†ํ•˜๊ธฐ

๊ธฐ์กด์— ์กด์žฌํ•˜๋˜ ์†Œ์Šค๋ฅผ ์ตœ๋Œ€ํ•œ ์žฌํ™œ์šฉํ•˜๋ฉฐ, ๊ฐ์ฒด์ง€ํ–ฅ ์ƒํ™œ ์ฒด์กฐ 9๊ฐ€์ง€ ์›์น™์— ๋”ฐ๋ผ ๊ฐœ๋ฐœ์„ ์ง„ํ–‰ํ•œ๋‹ค.

 

๊ธฐ์กด์— ์กด์žฌํ•˜๋˜ ๋ฐœ๊ถŒ ๋กœ์ง

๊ธฐ์กด์— ๊ฐœ๋ฐœํ•œ ๋ฐœ๊ถŒ ํ”„๋กœ์„ธ์Šค๋Š” ์‚ฌ์šฉ์ž ์ฟ ํฐํƒ€์ž…, ๊ณ„์ •, ๊ธˆ์•ก, ์—ฐ๋ฝ์ฒ˜๋ฅผ ์ž…๋ ฅ๋ฐ›์•„ ๊ณ„์ •์— ๋“ฑ๋ก๋œ ์ฟ ํฐ ์„ค์ • ์ •๋ณด ๊ฐ’์„ DB ์—์„œ ์ฝ์–ด๋“ค์ธ ํ›„,

์ฟ ํฐ๋ฒˆํ˜ธ ์ƒ์„ฑ ๋กœ์ง์„ ํƒœ์›Œ ์ •๋ณด๋ฅผ ์ €์žฅํ•˜๊ณ  ์žˆ๋‹ค.

 

ํ˜„์กดํ•˜๋Š” ๊ธฐ๋Šฅ

1. ๊ณ„์ •์— ํ• ๋‹น๋œ ์ฟ ํฐ ์„ค์ • ์ •๋ณด ์ฝ๊ธฐ

2. ์ฟ ํฐ๋ฒˆํ˜ธ ์ƒ์„ฑ ๋กœ์ง

3. ์ฟ ํฐ๋ฒˆํ˜ธ ์ €์žฅ(๋ฐœ๊ถŒ) ๋กœ์ง

4. ์ฟ ํฐ๋ฒˆํ˜ธ ๋ฐœ์†ก ๋กœ์ง

5. ์ฟ ํฐ ์ •๋ณด ์ฝ๊ธฐ

 

ํ•ฉ์น  ๊ธฐ๋Šฅ

๊ธฐ์กด์— ๋ฐœ์†ก๋œ ์ฟ ํฐ ๋ฒˆํ˜ธ๋ฅผ ๋™์ผํ•œ ์—ฐ๋ฝ์ฒ˜์— ์žฌ๋ฐœ์†ก

 

๋‹ค์ด์–ดํŠธ ๋กœ์ง

๋ฐœ์†ก์„ ๋‹ด๋‹นํ•˜๋Š” ํ”„๋กœ์„ธ์Šค๊ฐ€ ๋ฉ”์†Œ๋“œ ๋‹จ์œ„๋กœ ์ถ”๊ฐ€๋˜๊ธธ ์›์น˜ ์•Š๋Š”๋‹ค.

๋ฐœ๊ถŒ ํ”„๋กœ์„ธ์Šค์˜ ๊ธฐ๋Šฅ๋“ค์€ ๊ฐœ๋ฐœ ๋‹น์‹œ ๋‹จ์ผ์›์น™์„ ์œ„ํ•ด ๋ชจ๋“ˆํ™”๋กœ ์‹ ๊ฒฝ์จ์„œ ๊ฐœ๋ฐœํ•˜์˜€๊ธฐ์— '2. ์ฟ ํฐ ๋ฒˆํ˜ธ ์ƒ์„ฑ ๋กœ์ง' ์—์„œ ๊ฐˆ๋ฆผ๊ธธ์„ ๋‚˜๋ˆ„๊ณ ,

'5. ์ฟ ํฐ ์ •๋ณด ์ฝ๊ธฐ' ์—์„œ ์ฒ˜๋ฆฌ ํ›„, '4. ์ฟ ํฐ๋ฒˆํ˜ธ ๋ฐœ์†ก ๋กœ์ง' ์œผ๋กœ ์ง„ํ–‰ํ•˜๋ฉด ๋˜๊ฒ ๋‹ค.

        //NOTE: additionalInfo <- HashMap<String, String>
        //NOTE: Convenience.StringUtils.rtnRnd(9999): ์ฟ ํฐ ๋ฒˆํ˜ธ ์ƒ์„ฑ(๋‚œ์ˆ˜)
        additionalInfo = couponModel.getCouponNo() == null ?
                couponMapper.additionalInfo(
                        Convenience.StringUtils.rtnRnd(9999) + //NOTE: ์ค‘๊ฐ„ 4์ž๋ฆฌ
                                Convenience.StringUtils.rtnRnd(9999), //NOTE: ๋ 4์ž๋ฆฌ
                        couponModel.getGroup())
                :
                couponMapper.getCouponInfo(couponModel.getCouponNo());
                
            couponModel.setCouponNo(additionalInfo.get("couponNo"));
            couponModel.setExpireDate(additionalInfo.get("expireDate"));

 

๋ฐ˜์‘ํ˜•
Contents

ํฌ์ŠคํŒ… ์ฃผ์†Œ๋ฅผ ๋ณต์‚ฌํ–ˆ์Šต๋‹ˆ๋‹ค

์ด ๊ธ€์ด ๋„์›€์ด ๋˜์—ˆ๋‹ค๋ฉด ๊ณต๊ฐ ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค.