mirror of
http://git.mhez-qa.uplus.co.kr/hubez/hubez-admin.git
synced 2025-12-06 17:43:44 +09:00
Merge branch 'pre_pay' into develop
This commit is contained in:
371
frontend/src/modules/custMgt/components/PrePayRegPop.vue
Normal file
371
frontend/src/modules/custMgt/components/PrePayRegPop.vue
Normal file
@@ -0,0 +1,371 @@
|
||||
<template>
|
||||
<!-- <div class="wrap bg-wrap"> -->
|
||||
<div>
|
||||
<div class="dimmed prePay" @click="ModalClose();"></div>
|
||||
<div class="popup-wrap prePay">
|
||||
<!-- 선불 ID 생성 -->
|
||||
<div class="popup prePay popup_form">
|
||||
<div class="pop-head">
|
||||
<h3 class="pop-tit">선불 ID 생성</h3>
|
||||
</div>
|
||||
<form autocomplete="off">
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<td><input type="text" placeholder="아이디 입력" v-model.trim="userId" ref="_userId" @keypress="onlyId" @input="onlyId" minlength="6" maxlength="16"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>비밀번호</th>
|
||||
<td><input type="password" @keypress="onlyPassword" @input="onlyPassword" required minlength="8" maxlength="16" ref="_pwd1" v-model.trim="userPwd1"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>비밀번호 확인</th>
|
||||
<td><input type="password" @keypress="onlyPassword" @input="onlyPassword" required minlength="8" maxlength="16" ref="_pwd2" v-model.trim="userPwd2"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>이름</th>
|
||||
<td><input type="text" @keypress="onlyText" @input="onlyText" v-model.trim="userNm" ref="_userNm" required maxlength="40"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>휴대폰번호</th>
|
||||
<td><input type="text" placeholder="- 자 제외 숫자만 입력" v-model.trim="mdn" @keypress="onlyNum" @input="onlyNum" minlength="10" maxlength="11" ref="_phone"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>이메일</th>
|
||||
<td><input type="email" v-model.trim="email" @keypress="onlyEmail" @input="onlyEmail" maxlength="100" ref="_email"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>고객사명</th>
|
||||
<td><input type="text" @keypress="onlyText" @input="onlyText" v-model.trim="custNm" ref="custNm" required maxlength="40"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>사업자번호</th>
|
||||
<td><input type="text" @keypress="onlyNum" @input="onlyNum" v-model.trim="bizrno" ref="bizrno" required maxlength="40"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>고객유형코드</th>
|
||||
<td><input type="text" @keypress="onlyText" @input="onlyText" v-model.trim="custTyCd" ref="custTyCd" required maxlength="40"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>법인번호</th>
|
||||
<td><input type="text" @keypress="onlyText" @input="onlyText" v-model.trim="corpno" ref="corpno" maxlength="40"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>대표자명</th>
|
||||
<td><input type="text" @keypress="onlyText" @input="onlyText" v-model.trim="reprNm" ref="reprNm" maxlength="40"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>우편번호</th>
|
||||
<td><input type="text" @keypress="onlyText" @input="onlyText" v-model.trim="zipcd" ref="zipcd" maxlength="40"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>주소1</th>
|
||||
<td><input type="text" @keypress="onlyText" @input="onlyText" v-model.trim="addr1" ref="addr1" maxlength="40"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>주소2</th>
|
||||
<td><input type="text" @keypress="onlyText" @input="onlyText" v-model.trim="addr2" ref="addr2" maxlength="40"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th class="center">상태</th>
|
||||
<td>
|
||||
<input type="radio" name="state" value="01" id="popup_radio1" v-model="userStat">
|
||||
<label for="popup_radio1">사용</label>
|
||||
<input type="radio" name="state" value="02" id="popup_radio2" v-model="userStat">
|
||||
<label for="popup_radio2">정지</label>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
<div class="popup-btn2">
|
||||
<button class="btn-pcolor" @click="doInsert">저장</button>
|
||||
<button class="btn-default" @click="ModalClose();">취소</button>
|
||||
</div>
|
||||
</div>
|
||||
<common-modal ref="commmonModal"></common-modal>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import api from '@/service/api';
|
||||
import custMgtApi from "../service/custMgtApi.js";
|
||||
import {utils_mixin, chkPattern2} from '../service/mixins';
|
||||
import lodash from "lodash";
|
||||
import commonModal from "../components/commonModal";
|
||||
import ValidationConfirmPop from "@/modules/custMgt/components/ValidationConfirmPop";
|
||||
|
||||
export default {
|
||||
name: "prePayRegPop",
|
||||
mixins: [utils_mixin, chkPattern2],
|
||||
watch: {
|
||||
stat() {
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
row: {},
|
||||
userId: '',
|
||||
name: '',
|
||||
mdn: '',
|
||||
email: '',
|
||||
userStat: '01',
|
||||
userNm: "",
|
||||
userPwd1: "",
|
||||
userPwd2: "",
|
||||
code: "",
|
||||
custNm: "",
|
||||
bizrno: "",
|
||||
custTyCd: "GC",
|
||||
corpno: "",
|
||||
reprNm: "",
|
||||
zipcd: "",
|
||||
addr1: "",
|
||||
addr2: ""
|
||||
}
|
||||
},
|
||||
model: {
|
||||
prop: 'sendData',
|
||||
event: 'event-data'
|
||||
},
|
||||
props: ['sendData'],
|
||||
components: {
|
||||
commonModal,
|
||||
},
|
||||
created() {
|
||||
this.formReset();
|
||||
},
|
||||
methods: {
|
||||
doPwdValidate() {
|
||||
if (this.isNull(this.userPwd1)) {
|
||||
this.row.title = '청약고객관리';
|
||||
this.row.msg1 = '비밀번호를 입력해 주세요.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
this.$refs._pwd1.focus();
|
||||
return false;
|
||||
}
|
||||
if (this.isNull(this.userPwd2)) {
|
||||
this.row.title = '청약고객관리';
|
||||
this.row.msg1 = '비밀번호 확인을 입력해 주세요.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
this.$refs._pwd2.focus();
|
||||
return false;
|
||||
}
|
||||
if (!lodash.isEqual(this.userPwd1, this.userPwd2)) {
|
||||
this.row.title = '청약고객관리';
|
||||
this.row.msg1 = '비밀번호가 일치하지 않습니다.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
this.$refs._pwd2.focus();
|
||||
return false;
|
||||
}
|
||||
const pwdLen = this.bytes(this.userPwd1);
|
||||
if (!(pwdLen >= 8 && pwdLen <= 16)) {
|
||||
this.row.title = '청약고객관리';
|
||||
this.row.msg1 = '비밀번호는 8~16자의 영문, 숫자, 특수문자(!,@, $, %, ^, &, *) 조합이 필요합니다.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
this.$refs._pwd1.focus();
|
||||
return false;
|
||||
}
|
||||
const pEng = /[A-Za-z]/g; // 영문자
|
||||
const pNum = /[0-9]/g; // 숫자
|
||||
const pSpc = /[!@$%^&*]/g; // 특수문자
|
||||
if (!(pEng.test(this.userPwd1) && pNum.test(this.userPwd1) && pSpc.test(this.userPwd1))) {
|
||||
this.row.title = '청약고객관리';
|
||||
this.row.msg1 = '비밀번호는 8~16자의 영문, 숫자, 특수문자(!,@, $, %, ^, &, *) 조합이 필요합니다.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
this.$refs._pwd1.focus();
|
||||
return;
|
||||
}
|
||||
this.row.userPw = this.userPwd1;
|
||||
return true;
|
||||
},
|
||||
doValidate() {
|
||||
if (this.isNull(this.userId)) {
|
||||
this.row.title = '청약고객관리';
|
||||
this.row.msg1 = '아이디를 입력해 주세요.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
this.$refs._userId.focus();
|
||||
return false;
|
||||
}
|
||||
// 청약 ID 길이 체크 6~16
|
||||
var userIdlength = this.userId.length;
|
||||
if (userIdlength < 6 || userIdlength > 16) {
|
||||
this.row.title = '청약고객관리';
|
||||
this.row.msg1 = 'ID 형식에 맞지 않습니다.';
|
||||
this.row.msg2 = '확인하여 다시 등록 부탁 드립니다.';
|
||||
this.row.focusTaget = '1';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!this.doPwdValidate()) {
|
||||
return false;
|
||||
}
|
||||
if (this.isNull(this.userNm)) {
|
||||
this.row.title = '청약고객관리';
|
||||
this.row.msg1 = '이름을 입력해 주세요.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
this.$refs._userNm.focus();
|
||||
return false;
|
||||
}
|
||||
if (this.isNull(this.mdn)) {
|
||||
this.row.title = '청약고객관리';
|
||||
this.row.msg1 = '휴대폰번호를 입력해주세요.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
this.$refs._phone.focus();
|
||||
return false;
|
||||
}
|
||||
const hp = this.mdn;
|
||||
if (!this.isNull(hp) && !this.isMobile(hp)) {
|
||||
this.row.title = '청약고객관리';
|
||||
this.row.msg1 = '휴대폰 번호 형식이 잘못되었습니다. 확인해 주세요.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
this.$refs._phone.focus();
|
||||
return false;
|
||||
}
|
||||
if (this.isNull(this.email)) {
|
||||
this.row.title = '청약고객관리';
|
||||
this.row.msg1 = '이메일을 입력해주세요.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
this.$refs._email.focus();
|
||||
return false;
|
||||
}
|
||||
const email = this.email;
|
||||
if (!this.isNull(email) && !lodash.isEqual(email, '@') && !this.emailCheck(email)) {
|
||||
this.row.title = '청약고객관리';
|
||||
this.row.msg1 = '이메일 형식이 잘못되었습니다. 확인해 주세요.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
this.$refs._email.focus();
|
||||
return false;
|
||||
}
|
||||
if (this.isNull(this.userStat)) {
|
||||
this.row.title = '청약고객관리';
|
||||
this.row.msg1 = '상태를 선택 해주세요.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
// this.$refs._auth.focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.isNull(this.userNm)) {
|
||||
this.row.title = '청약고객관리';
|
||||
this.row.msg1 = '이름을 입력해 주세요.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
this.$refs._userNm.focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.isNull(this.userNm)) {
|
||||
this.row.title = '청약고객관리';
|
||||
this.row.msg1 = '이름을 입력해 주세요.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
this.$refs._userNm.focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.isNull(this.userNm)) {
|
||||
this.row.title = '청약고객관리';
|
||||
this.row.msg1 = '이름을 입력해 주세요.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
this.$refs._userNm.focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.isNull(this.userNm)) {
|
||||
this.row.title = '청약고객관리';
|
||||
this.row.msg1 = '이름을 입력해 주세요.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
this.$refs._userNm.focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.isNull(this.custNm)) {
|
||||
this.row.title = '청약고객관리';
|
||||
this.row.msg1 = '고객사명을 입력해 주세요.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
this.$refs._userNm.focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.isNull(this.bizrno)) {
|
||||
this.row.title = '청약고객관리';
|
||||
this.row.msg1 = '사업자번호를 입력해 주세요.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
this.$refs._userNm.focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
this.row.userId = this.userId;
|
||||
this.row.userNm = this.userNm;
|
||||
this.row.mdn = hp;
|
||||
this.row.userEmail = email;
|
||||
this.row.userStat = this.userStat;
|
||||
|
||||
this.row.custNm = this.custNm;
|
||||
this.row.bizrno = this.bizrno;
|
||||
this.row.custTyCd = this.custTyCd;
|
||||
this.row.corpno = this.corpno;
|
||||
this.row.reprNm = this.reprNm;
|
||||
this.row.zipcd = this.zipcd;
|
||||
this.row.addr1 = this.addr1;
|
||||
this.row.addr2 = this.addr2;
|
||||
|
||||
return true;
|
||||
},
|
||||
// 모달 띄우기
|
||||
ModalOpen() {
|
||||
// 모달 오픈
|
||||
var dimmed = document.getElementsByClassName('prePay');
|
||||
for (var i = 0; i < dimmed.length; i++) {
|
||||
dimmed[i].style.display = 'block';
|
||||
}
|
||||
this.formReset();
|
||||
},
|
||||
// 모달 끄기
|
||||
ModalClose() {
|
||||
var dimmed = document.getElementsByClassName('prePay');
|
||||
for (var i = 0; i < dimmed.length; i++) {
|
||||
dimmed[i].style.display = 'none';
|
||||
}
|
||||
},
|
||||
// 저장 후 부모창 호출.
|
||||
toComplete() {
|
||||
this.getParent('memberList').$refs.table.reloadData();
|
||||
this.ModalClose();
|
||||
},
|
||||
async doInsert() {
|
||||
if (this.doValidate()) {
|
||||
|
||||
try {
|
||||
const response = await custMgtApi.insertPrePayId(this.row);
|
||||
const result = response.data;
|
||||
if (result != null && result.retCode == "0000") {
|
||||
this.toComplete();
|
||||
} else if (result != null && result.retCode == "1009") {
|
||||
this.row.title = '청약고객관리';
|
||||
this.row.msg1 = '실패 하였습니다.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
} else if (result != null && result.retCode == "4018") {
|
||||
this.row.title = '청약고객관리';
|
||||
this.row.msg1 = '중복된 아이디 입니다.';
|
||||
this.row.msg2 = '아이디를 다시 확인하여 등록 부탁드립니다.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
}
|
||||
} catch (err) {
|
||||
this.row.title = '청약고객관리';
|
||||
this.row.msg1 = '실패 하였습니다.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
}
|
||||
}
|
||||
},
|
||||
formReset() {
|
||||
// this.$refs.adminRegForm.reset();
|
||||
Object.assign(this.$data, this.$options.data());
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -78,6 +78,10 @@ const insertTestId = (params) => {
|
||||
return httpClient.post('/api/v1/bo/custMgt/insertTestId', params);
|
||||
}
|
||||
|
||||
const insertPrePayId = (params) => {
|
||||
return httpClient.post('/api/v1/bo/custMgt/insertPrePayId', params);
|
||||
}
|
||||
|
||||
// 메모삭제
|
||||
const deleteMemo = (params) => {
|
||||
return httpClient.post('/api/v1/bo/custMgt/deleteMemo', params);
|
||||
@@ -153,6 +157,7 @@ export default {
|
||||
updateAdminInfoTotal,
|
||||
deleteMemo,
|
||||
insertTestId,
|
||||
insertPrePayId,
|
||||
duplicateCheckUserId,
|
||||
chrgList,
|
||||
insertChrg,
|
||||
|
||||
@@ -90,7 +90,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="button_group">
|
||||
<button type="button" class="button blue add" @click="ModalOpen();">테스트 ID 생성</button>
|
||||
<button type="button" class="button blue add" @click="ModalOpen('testId');">테스트 ID 생성</button>
|
||||
<button type="button" class="button blue add" @click="ModalOpen('prePay');">선불 ID 생성</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -111,6 +112,7 @@
|
||||
</div>
|
||||
|
||||
<testId-reg-pop ref="testIdRegPop"></testId-reg-pop>
|
||||
<prePay-reg-pop ref="prePayRegPop"></prePay-reg-pop>
|
||||
<common-modal ref="commmonModal"></common-modal>
|
||||
|
||||
</div>
|
||||
@@ -121,6 +123,7 @@
|
||||
<script>
|
||||
import customGrid from '@/components/CustomGrid';
|
||||
import TestIdRegPop from '../components/TestIdRegPop';
|
||||
import PrePayRegPop from '../components/PrePayRegPop';
|
||||
import moment from 'moment';
|
||||
import api from '@/service/api.js';
|
||||
import commonModal from "@/components/modal/commonModal";
|
||||
@@ -213,6 +216,7 @@ export default {
|
||||
components: {
|
||||
customGrid: customGrid,
|
||||
TestIdRegPop,
|
||||
PrePayRegPop,
|
||||
commonModal,
|
||||
vuejsDatepicker,
|
||||
},
|
||||
@@ -281,8 +285,13 @@ export default {
|
||||
toMove(routeName) {
|
||||
this.$router.push({name: routeName, params: {page: 1, searchText: ''}});
|
||||
},
|
||||
ModalOpen: function () {
|
||||
this.$refs.testIdRegPop.ModalOpen();
|
||||
ModalOpen: function (regDiv) {
|
||||
if(regDiv == 'testId'){
|
||||
this.$refs.testIdRegPop.ModalOpen();
|
||||
}else{
|
||||
this.$refs.prePayRegPop.ModalOpen();
|
||||
}
|
||||
|
||||
},
|
||||
memberDetail: function (props) {
|
||||
this.row.serviceId = props.userId;
|
||||
|
||||
@@ -43,6 +43,8 @@ import kr.co.uplus.ez.api.custMgt.dto.InsertChrgReqDto;
|
||||
import kr.co.uplus.ez.api.custMgt.dto.InsertChrgResDto;
|
||||
import kr.co.uplus.ez.api.custMgt.dto.InsertMassUserReqDto;
|
||||
import kr.co.uplus.ez.api.custMgt.dto.InsertMassUserResDto;
|
||||
import kr.co.uplus.ez.api.custMgt.dto.InsertPrePayReqDto;
|
||||
import kr.co.uplus.ez.api.custMgt.dto.InsertPrePayResDto;
|
||||
import kr.co.uplus.ez.api.custMgt.dto.InsertTestIdReqDto;
|
||||
import kr.co.uplus.ez.api.custMgt.dto.InsertTestIdResDto;
|
||||
import kr.co.uplus.ez.api.custMgt.dto.InsertUserReqDto;
|
||||
@@ -315,6 +317,32 @@ public class CustMgtController {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* auth : ckr
|
||||
* desc : 선불ID 등록
|
||||
* @param paramMap
|
||||
* @return
|
||||
* @
|
||||
*/
|
||||
@ApiOperation(value = "insertPrePayId", notes = "선불ID 등록")
|
||||
@ApiResponses({
|
||||
@ApiResponse(code = HttpServletResponse.SC_OK, message = "SUCESS")
|
||||
})
|
||||
@RequestMapping(value = "/insertPrePayId" , method = {RequestMethod.POST})
|
||||
@ResponseBody
|
||||
public InsertPrePayResDto insertPrePayId(@RequestBody @Valid InsertPrePayReqDto insertPrePayReqDto, BindingResult bindingResult){
|
||||
if(validComponents.validParameter(bindingResult)) {
|
||||
return new InsertPrePayResDto(ApiResponseCode.CM_PARAMETER_ERROR);
|
||||
}
|
||||
try {
|
||||
return custService.InsertPrePay(insertPrePayReqDto);
|
||||
}catch(Exception e) {
|
||||
logger.info(e.toString());
|
||||
return new InsertPrePayResDto(ApiResponseCode.CM_DB_QUERY_ERR);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* date : 2022. 4. 25.
|
||||
* auth : ckr
|
||||
|
||||
@@ -87,6 +87,8 @@ public interface CustMgtMapper {
|
||||
|
||||
String getSubId();
|
||||
|
||||
String getPreSubId();
|
||||
|
||||
String getEntrNo();
|
||||
|
||||
/** 청약 상태 이력 저장 */
|
||||
|
||||
@@ -575,6 +575,152 @@ public class CustMgtService {
|
||||
return new InsertTestIdResDto(ApiResponseCode.SUCCESS);
|
||||
}
|
||||
|
||||
/**
|
||||
* 선불 회원 등록
|
||||
* @param insertPrePayReqDto
|
||||
* @return
|
||||
*/
|
||||
@Transactional(value="db1TransactionManager")
|
||||
public InsertPrePayResDto InsertPrePay(InsertPrePayReqDto insertPrePayReqDto){
|
||||
|
||||
CustMgtMapper custMgtMapper = sqlSessionMaster.getMapper(CustMgtMapper.class);
|
||||
|
||||
int getUserIdCount = custMgtMapper.getUserIdCount(insertPrePayReqDto.getUserId());
|
||||
|
||||
// 이미 존재하는 아이디.
|
||||
if (getUserIdCount > 0) {
|
||||
return new InsertPrePayResDto(ApiResponseCode.CE_DUPLICATE_ID);
|
||||
}
|
||||
|
||||
// 1. 사업자 번호로 조회.
|
||||
int checkCustInfo = custMgtMapper.selectCustInfoCount(insertPrePayReqDto.getBizrno());
|
||||
String custSeq = custMgtMapper.getCustSeq(insertPrePayReqDto.getBizrno());
|
||||
|
||||
Object principal = SecurityContextHolder.getContext().getAuthentication().getPrincipal();
|
||||
UserDetails userDetails = (UserDetails) principal;
|
||||
String regId = userDetails.getUsername();
|
||||
|
||||
if (checkCustInfo < 1) {
|
||||
// 1-2. 사업자 번호로 미존재시 : 고객정보 등록.
|
||||
CustInfo custInfo = new CustInfo();
|
||||
custInfo.setCustSeq(custSeq);
|
||||
custInfo.setBizrno(insertPrePayReqDto.getBizrno());
|
||||
custInfo.setCustNm(insertPrePayReqDto.getCustNm());
|
||||
custInfo.setCustTyCd(insertPrePayReqDto.getCustTyCd());
|
||||
custInfo.setCorpno(insertPrePayReqDto.getCorpno());
|
||||
custInfo.setReprNm(insertPrePayReqDto.getReprNm());
|
||||
custInfo.setBrthdy("");
|
||||
custInfo.setZipcd(insertPrePayReqDto.getZipcd());
|
||||
custInfo.setAddr1(insertPrePayReqDto.getAddr1());
|
||||
custInfo.setAddr2(insertPrePayReqDto.getAddr2());
|
||||
custInfo.setRegId(regId);
|
||||
custInfo.setChgId(regId);
|
||||
// 고객정보 등록.
|
||||
custMgtMapper.insertCustInfo(custInfo);
|
||||
}
|
||||
|
||||
// 2. 서비스 이용자 등록.
|
||||
String userSeq = custMgtMapper.getUserSeq();
|
||||
SvcUserInfo svcUserInfo = new SvcUserInfo();
|
||||
svcUserInfo.setUserSeq(userSeq);
|
||||
svcUserInfo.setUserId(insertPrePayReqDto.getUserId());
|
||||
svcUserInfo.setUserNm(insertPrePayReqDto.getUserNm());
|
||||
svcUserInfo.setUserSttusCd(Const.USER_STTUS_CD_NOMAL);
|
||||
svcUserInfo.setCustSeq(custSeq);
|
||||
svcUserInfo.setUserTpCd(Const.USER_TP_CD_ADM);
|
||||
svcUserInfo.setPrntsUserSeq(userSeq);
|
||||
svcUserInfo.setPwd(insertPrePayReqDto.getUserPw());
|
||||
svcUserInfo.setBizrAuthYn(Const.COMM_NO);
|
||||
svcUserInfo.setLineTpCd(Const.LINE_TP_CD_NORMAL);
|
||||
svcUserInfo.setHpNo(insertPrePayReqDto.getMdn());
|
||||
svcUserInfo.setEmail(insertPrePayReqDto.getUserEmail());
|
||||
svcUserInfo.setAuthcd080(custMgtMapper.getAuth080());
|
||||
svcUserInfo.setAutCd(Const.USER_AUTCD_ADM);
|
||||
svcUserInfo.setRegId(regId);
|
||||
svcUserInfo.setChgId(regId);
|
||||
|
||||
// 서비스 이용자 등록.
|
||||
custMgtMapper.insertSvcUserInfo(svcUserInfo);
|
||||
|
||||
// 3. 청약정보 등록
|
||||
SubsInfo subsInfo = new SubsInfo();
|
||||
String subId = custMgtMapper.getPreSubId();
|
||||
subsInfo.setSubsId(subId);
|
||||
subsInfo.setEntrNo("");
|
||||
subsInfo.setUserSeq(userSeq);
|
||||
subsInfo.setCustSeq(custSeq);
|
||||
subsInfo.setJoinDiv("02"); //선불 회원
|
||||
subsInfo.setSubsSttusCd(Const.SUBS_STTUS_CD_NORMAL);
|
||||
subsInfo.setProdCd(Const.PRE_PAY_PROD);
|
||||
subsInfo.setBindDcYn(Const.COMM_NO);
|
||||
subsInfo.setRegId(regId);
|
||||
subsInfo.setChgId(regId);
|
||||
|
||||
// 청약정보 등록.
|
||||
custMgtMapper.insertSubsInfo(subsInfo);
|
||||
|
||||
// 청약상태_이력 테이블 개통 이력 insert
|
||||
Date now = new Date();
|
||||
String subsDt = DateUtils.dateToStr(now, "yyyyMMddHHmmss");
|
||||
SbscstHstDto newSbscstHst = new SbscstHstDto();
|
||||
newSbscstHst.setSubsId(subId); // 청약ID
|
||||
newSbscstHst.setEfctStDt(subsDt); // 유효 종료 일시
|
||||
newSbscstHst.setProdCd(Const.PRE_PAY_PROD); // 상품 코드
|
||||
newSbscstHst.setSubsSttusCd(Const.SUBS_STTUS_CD_NORMAL); // 청약 상태 코드
|
||||
newSbscstHst.setRegId(regId); // 변경 ID
|
||||
// 청약 이력 등록
|
||||
custMgtMapper.insertSbscstHst(newSbscstHst);
|
||||
|
||||
// 1. 한도 초기화
|
||||
// 1-1. 상품금액 조회
|
||||
ProdInfo prodInfo = new ProdInfo();
|
||||
prodInfo = custMgtMapper.getProdAmt(userSeq);
|
||||
String prodAmt = prodInfo.getProdAmt();
|
||||
|
||||
|
||||
// 1-2. 오더 채번
|
||||
String order = custMgtMapper.getOrder();
|
||||
String orderCretDt = order.substring(0,12);
|
||||
|
||||
// 1-3. 오더 추가
|
||||
OrderDto orderDto = new OrderDto();
|
||||
orderDto.setOrderId(order);
|
||||
orderDto.setOrderCretDt(orderCretDt);
|
||||
orderDto.setOrderTyCd(Const.ORDER_TYPE_CD_03); // 한도초기화 하기 위한 주문 유형 코드 (01:발송차감, 02:차감결과처리, 03:한도초기화, 04:이월금소멸)
|
||||
orderDto.setRegId(regId);
|
||||
custMgtMapper.insertOrder(orderDto);
|
||||
|
||||
// 1-4. 차감 상세 INSERT
|
||||
LmtdctDtlDto lmtdctDtlDto = new LmtdctDtlDto();
|
||||
lmtdctDtlDto.setOrderCretDt(orderCretDt); // 오더 생성일시
|
||||
lmtdctDtlDto.setUserSeq(userSeq); // 이용자 일련번호
|
||||
String lmtYm = subsDt.substring(0,6);
|
||||
lmtdctDtlDto.setLmtYm(lmtYm); // 한도 년월
|
||||
lmtdctDtlDto.setUseYm(lmtYm); // 사용 년월
|
||||
lmtdctDtlDto.setLmtTpCd(Const.LMTDCT_DTL_TYPE_CD_01); // 한도 유형 코드
|
||||
lmtdctDtlDto.setDdctTpcd(Const.LMTDCT_DTL_DDCT_TYPE_CD_04); // 차감 유형 코드
|
||||
lmtdctDtlDto.setDdctAmt(prodAmt); // 차감 금액
|
||||
lmtdctDtlDto.setExeOrderId(order); // 실행 오더 ID
|
||||
lmtdctDtlDto.setSnddctOrderId(order); // 발송 차감 오더 ID
|
||||
lmtdctDtlDto.setRegId(regId); // 등록 ID
|
||||
|
||||
custMgtMapper.insertLmtdctDtl(lmtdctDtlDto);
|
||||
|
||||
// 1-5. 한도 INSERT
|
||||
UserLmtDto userLmtDto = new UserLmtDto();
|
||||
userLmtDto.setUserSeq(userSeq); // 이용자 일련번호
|
||||
userLmtDto.setLmtYm(lmtYm); // 한도 년월
|
||||
userLmtDto.setFxLmtAmt(prodAmt); // 정액 한도 금액
|
||||
userLmtDto.setMrtLmtAmt(prodAmt); // 종량 한도 금액
|
||||
userLmtDto.setFxBlnc(prodAmt); // 정액 잔액
|
||||
userLmtDto.setRegId(regId); // 등록자ID
|
||||
userLmtDto.setChgId(regId); // 변경자ID
|
||||
|
||||
custMgtMapper.insertUserLmt(userLmtDto);
|
||||
|
||||
return new InsertPrePayResDto(ApiResponseCode.SUCCESS);
|
||||
}
|
||||
|
||||
/**
|
||||
* date : 2022. 4. 25. auth : ckr desc : 전체 메모 목록 조회
|
||||
*
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
package kr.co.uplus.ez.api.custMgt.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@Data
|
||||
public class InsertPrePayReqDto implements Serializable {
|
||||
|
||||
@NotNull
|
||||
@ApiModelProperty(example = "선불 계정 ID", name = "선불 계정 ID", dataType = "String")
|
||||
private String userId;
|
||||
|
||||
@NotNull
|
||||
@ApiModelProperty(example = "선불 계정 비밀번호", name = "선불 계정 비밀번호", dataType = "String")
|
||||
private String userPw;
|
||||
|
||||
@NotNull
|
||||
@ApiModelProperty(example = "선불 계정의 이름", name = "선불 계정의 이름", dataType = "String")
|
||||
private String userNm;
|
||||
|
||||
@NotNull
|
||||
@ApiModelProperty(example = "선불 계정의 휴대폰 번호", name = "선불 계정의 휴대폰 번호", dataType = "String")
|
||||
private String mdn;
|
||||
|
||||
@NotNull
|
||||
@ApiModelProperty(example = "선불 계정의 Email", name = "선불 계정의 Email", dataType = "String")
|
||||
private String userEmail;
|
||||
|
||||
@NotNull
|
||||
@ApiModelProperty(example = "선불 계정의 고객사명", name = "선불 계정의 고객사명", dataType = "String")
|
||||
private String custNm;
|
||||
|
||||
@NotNull
|
||||
@ApiModelProperty(example = "선불 계정의 사업자번호", name = "선불 계정의 사업자번호", dataType = "String")
|
||||
private String bizrno;
|
||||
|
||||
@ApiModelProperty(example = "선불 계정의 고객유형코드", name = "선불 계정의 고객유형코드", dataType = "String")
|
||||
private String custTyCd;
|
||||
|
||||
@ApiModelProperty(example = "선불 계정의 법인번호", name = "선불 계정의 법인번호", dataType = "String")
|
||||
private String corpno;
|
||||
|
||||
@ApiModelProperty(example = "선불 계정의 업종", name = "선불 계정의 업종", dataType = "String")
|
||||
private String tpind;
|
||||
|
||||
@ApiModelProperty(example = "선불 계정의 업태", name = "선불 계정의 업태", dataType = "String")
|
||||
private String bizcd;
|
||||
|
||||
@ApiModelProperty(example = "선불 계정의 종목", name = "선불 계정의 종목", dataType = "String")
|
||||
private String anitem;
|
||||
|
||||
@ApiModelProperty(example = "선불 계정의 대표자_명", name = "선불 계정의 대표자_명", dataType = "String")
|
||||
private String reprNm;
|
||||
|
||||
@ApiModelProperty(example = "선불 계정의 우편번호", name = "선불 계정의 우편번호", dataType = "String")
|
||||
private String zipcd;
|
||||
|
||||
@ApiModelProperty(example = "선불 계정의 주소1", name = "선불 계정의 주소1", dataType = "String")
|
||||
private String addr1;
|
||||
|
||||
@ApiModelProperty(example = "선불 계정의 주소2", name = "선불 계정의 주소", dataType = "String")
|
||||
private String addr2;
|
||||
|
||||
@NotNull
|
||||
@ApiModelProperty(example = "선불 계정의 상태", name = "선불 계정의 상태", notes = "Y(사용)/N(정지)", dataType = "String")
|
||||
private String userStat;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package kr.co.uplus.ez.api.custMgt.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import kr.co.uplus.ez.common.data.ApiResponseCode;
|
||||
import kr.co.uplus.ez.common.data.ResponseMessage;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@Data
|
||||
public class InsertPrePayResDto extends ResponseMessage implements Serializable {
|
||||
|
||||
// 데이터.
|
||||
private Object data;
|
||||
|
||||
public InsertPrePayResDto() {
|
||||
this.retCode = ApiResponseCode.SUCCESS.getResultCode();
|
||||
this.retMsg = ApiResponseCode.SUCCESS.getResultMsg();
|
||||
}
|
||||
|
||||
public InsertPrePayResDto(ApiResponseCode returnStr) {
|
||||
this.retCode = returnStr.getResultCode();
|
||||
this.retMsg = returnStr.getResultMsg();
|
||||
}
|
||||
|
||||
public InsertPrePayResDto(ApiResponseCode returnStr, Object data) {
|
||||
this.retCode = returnStr.getResultCode();
|
||||
this.retMsg = returnStr.getResultMsg();
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -49,4 +49,7 @@ public class SubsInfo implements Serializable{
|
||||
/** 변경_일시 . */
|
||||
private String chgDt;
|
||||
|
||||
/** 회원 구분 */
|
||||
private String joinDiv;
|
||||
|
||||
}
|
||||
|
||||
@@ -147,6 +147,7 @@ public class Const {
|
||||
/** 한도 차감 상세 - 차감 유형 코드 (01:차감, 02:소멸, 03:복원, 04:충전) */
|
||||
public static final String LMTDCT_DTL_DDCT_TYPE_CD_04 = "04";
|
||||
|
||||
public static final String PRE_PAY_PROD = "LPZ0000000";
|
||||
|
||||
/** 배치 결과 */
|
||||
public static final String BATCH_MSG_SUCCESS = "SUCCESS";
|
||||
|
||||
@@ -830,6 +830,9 @@
|
||||
,ENTR_NO
|
||||
,USER_SEQ
|
||||
,CUST_SEQ
|
||||
<if test="joinDiv != null and joinDiv != ''">
|
||||
,JOIN_DIV
|
||||
</if>
|
||||
,SUBS_STTUS_CD
|
||||
,PROD_CD
|
||||
,SUBS_DT
|
||||
@@ -844,6 +847,9 @@
|
||||
,#{entrNo}
|
||||
, #{userSeq}
|
||||
, #{custSeq}
|
||||
<if test="joinDiv != null and joinDiv != ''">
|
||||
, #{joinDiv}
|
||||
</if>
|
||||
, #{subsSttusCd}
|
||||
, #{prodCd}
|
||||
, NOW()
|
||||
@@ -855,6 +861,7 @@
|
||||
, NOW()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<select id="selectUserSeq" parameterType="String" resultType="int">
|
||||
/* custMgt-mapper.xml(selectUserSeq) */
|
||||
SELECT USER_SEQ
|
||||
@@ -1004,6 +1011,10 @@
|
||||
SELECT CONCAT('TESTENTRN', LPAD(hubez_common.FUN_NEXT_SEQ('TEST_SUBS_SEQ'), 11, 0)) as ENTR_NO
|
||||
</select>
|
||||
|
||||
<select id="getPreSubId" resultType="String">
|
||||
SELECT CONCAT('PRESUBID', LPAD(hubez_common.FUN_NEXT_SEQ('PREPAY_SEQ'), 11, 0)) AS SUB_ID
|
||||
</select>
|
||||
|
||||
<!-- 청약 상태 이력 저장 -->
|
||||
<insert id="insertSbscstHst" parameterType="kr.co.uplus.ez.api.custMgt.dto.SbscstHstDto">
|
||||
/* custMgt-mapper.xml(insertSbscstHst) */
|
||||
|
||||
Reference in New Issue
Block a user