mirror of
http://git.mhez-qa.uplus.co.kr/hubez/hubez-admin.git
synced 2025-12-07 00:17:26 +09:00
선불 회원 등록 화면
This commit is contained in:
@@ -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;
|
||||
@@ -314,6 +316,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.
|
||||
|
||||
@@ -86,6 +86,8 @@ public interface CustMgtMapper {
|
||||
String selectApiAuthToken(String apiApplicationId);
|
||||
|
||||
String getSubId();
|
||||
|
||||
String getPreSubId();
|
||||
|
||||
String getEntrNo();
|
||||
|
||||
|
||||
@@ -574,6 +574,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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -48,5 +48,8 @@ public class SubsInfo implements Serializable{
|
||||
private String chgId;
|
||||
/** 변경_일시 . */
|
||||
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
|
||||
@@ -1002,6 +1009,10 @@
|
||||
|
||||
<select id="getEntrNo" resultType="String">
|
||||
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>
|
||||
|
||||
<!-- 청약 상태 이력 저장 -->
|
||||
|
||||
Reference in New Issue
Block a user