mirror of
http://git.mhez-qa.uplus.co.kr/hubez/hubez-admin.git
synced 2025-12-06 16:43:32 +09:00
청약 취소 수동 버튼
This commit is contained in:
@@ -27,6 +27,8 @@ import kr.co.uplus.ez.api.custMgt.dto.AdminInfoReqDto;
|
||||
import kr.co.uplus.ez.api.custMgt.dto.AdminInfoResDto;
|
||||
import kr.co.uplus.ez.api.custMgt.dto.AllMemoListReqDto;
|
||||
import kr.co.uplus.ez.api.custMgt.dto.AllMemoListResDto;
|
||||
import kr.co.uplus.ez.api.custMgt.dto.CancleSubsSttusReqDto;
|
||||
import kr.co.uplus.ez.api.custMgt.dto.CancleSubsSttusResDto;
|
||||
import kr.co.uplus.ez.api.custMgt.dto.CarryOverListReqDto;
|
||||
import kr.co.uplus.ez.api.custMgt.dto.CarryOverListResDto;
|
||||
import kr.co.uplus.ez.api.custMgt.dto.ChrgDetailReqDto;
|
||||
@@ -696,4 +698,20 @@ public class CustMgtController {
|
||||
return custService.userLmtListExcel(userLmtListExcelReqDto);
|
||||
}
|
||||
*/
|
||||
|
||||
@ApiOperation(value="cancleSubsSttus", notes = "청약 취소")
|
||||
@ApiResponses({
|
||||
@ApiResponse(code = HttpServletResponse.SC_OK, message = "SUCESS")
|
||||
})
|
||||
@RequestMapping(value = "/cancleSubsSttus" , method = {RequestMethod.POST})
|
||||
@ResponseBody
|
||||
public CancleSubsSttusResDto cancleSubsSttus(@RequestBody @Valid CancleSubsSttusReqDto cancleSubsSttusReqDto, BindingResult bindingResult) throws Exception {
|
||||
|
||||
|
||||
if(validComponents.validParameter(bindingResult)) {
|
||||
return new CancleSubsSttusResDto(ApiResponseCode.CM_PARAMETER_ERROR);
|
||||
}
|
||||
|
||||
return custService.CancleSubsSttus(cancleSubsSttusReqDto);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -145,4 +145,14 @@ public interface CustMgtMapper {
|
||||
// List<UserLmtList> selectBLNCLists(UserLmtListReqDto userLmtListReqDto);
|
||||
// /** 요금제 구매 내역 정보 엑셀 목록 조회.*/
|
||||
// List<UserLmtList> selectBLNCListsExcel(UserLmtListExcelReqDto userLmtListExcelReqDto);
|
||||
|
||||
// 임시개통, 비즈마켓 개통 상태 취소 시 상태변경
|
||||
/** 사용자 상태 변경 */
|
||||
void cancleUserSttusCd(CancleSubsSttusReqDto params);
|
||||
/** 고객 청약 상태 변경 */
|
||||
void cancleSubsSttusCd(CancleSubsSttusReqDto params);
|
||||
/** 청약상태 히스토리 업데이트 */
|
||||
void updateCancleSbscstHst(CancleSubsSttus params);
|
||||
/** 청약상태 히스토리 업데이트 */
|
||||
void cancleSbscstHst(CancleSubsSttus params);
|
||||
}
|
||||
|
||||
@@ -1527,5 +1527,47 @@ public class CustMgtService {
|
||||
return new UserLmtListExcelResDto(ApiResponseCode.SUCCESS,userLmtListRes);
|
||||
}
|
||||
*/
|
||||
@Transactional(value="db1TransactionManager")
|
||||
public CancleSubsSttusResDto CancleSubsSttus(CancleSubsSttusReqDto cancleSubsSttusReqDto) throws Exception {
|
||||
|
||||
CustMgtMapper custMgtMapper = sqlSessionMaster.getMapper(CustMgtMapper.class);
|
||||
logger.info("subsSttusCancle. subsId = {}, userId = {}",cancleSubsSttusReqDto.getSubsId(), cancleSubsSttusReqDto.getUserId());
|
||||
|
||||
//어드민 계정 가져오기
|
||||
Object principal = SecurityContextHolder.getContext().getAuthentication().getPrincipal();
|
||||
UserDetails userDetails = (UserDetails) principal;
|
||||
String regId = userDetails.getUsername();
|
||||
|
||||
|
||||
try {
|
||||
CancleSubsSttus selectEfctStDt = new CancleSubsSttus();
|
||||
|
||||
selectEfctStDt.setSubsId(cancleSubsSttusReqDto.getSubsId());
|
||||
selectEfctStDt.setChgId(regId);
|
||||
//1. 기존 이력 만료시키기
|
||||
custMgtMapper.updateCancleSbscstHst(selectEfctStDt);
|
||||
|
||||
selectEfctStDt.setEfctFnsDt("99991231");
|
||||
selectEfctStDt.setProdCd(cancleSubsSttusReqDto.getProdCd());
|
||||
selectEfctStDt.setRegId(regId);
|
||||
selectEfctStDt.setUserSttusCd("98");
|
||||
|
||||
//2. 취소 이력 정보 인서트
|
||||
custMgtMapper.cancleSbscstHst(selectEfctStDt);
|
||||
|
||||
//3. 사용자 상태 변경
|
||||
custMgtMapper.cancleUserSttusCd(cancleSubsSttusReqDto);
|
||||
|
||||
//4. 고객 청약상태 변경
|
||||
custMgtMapper.cancleSubsSttusCd(cancleSubsSttusReqDto);
|
||||
|
||||
} catch (Exception e) {
|
||||
// TODO: handle exception
|
||||
|
||||
logger.error("CustMgtService.CancleSubsSttus - cancle SubsStatus Error : {}", e.getMessage(), e);
|
||||
}
|
||||
|
||||
return new CancleSubsSttusResDto(ApiResponseCode.SUCCESS);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package kr.co.uplus.ez.api.custMgt.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@Data
|
||||
public class CancleSubsSttus implements Serializable{
|
||||
|
||||
@ApiModelProperty(example = "청약상태코드", name = "청약상태코드", dataType = "String")
|
||||
private String userSttusCd;
|
||||
|
||||
@ApiModelProperty(example = "유저 시퀀스", name = "유저 시퀀스", dataType = "String")
|
||||
private String userSeq;
|
||||
|
||||
@ApiModelProperty(example = "청약 ID", name = "청약 ID", dataType = "String")
|
||||
private String subsId;
|
||||
|
||||
@ApiModelProperty(example = "청약 상태 시작일", name = "청약 상태 시작일", dataType = "String")
|
||||
private String efctStDt;
|
||||
|
||||
@ApiModelProperty(example = "청약 상태 종료일", name = "청약 상태 종료일", dataType = "String")
|
||||
private String efctFnsDt;
|
||||
|
||||
@ApiModelProperty(example = "요금제코드", name = "요금제코드", dataType = "String")
|
||||
private String prodCd;
|
||||
|
||||
@ApiModelProperty(example = "등록ID", name = "등록ID", dataType = "String")
|
||||
private String regId;
|
||||
|
||||
@ApiModelProperty(example = "등록날짜", name = "등록날짜", dataType = "String")
|
||||
private String regDt;
|
||||
|
||||
@ApiModelProperty(example = "수정ID", name = "수정ID", dataType = "String")
|
||||
private String chgId;
|
||||
|
||||
@ApiModelProperty(example = "수정날짜", name = "수정날짜", dataType = "String")
|
||||
private String chgDt;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package kr.co.uplus.ez.api.custMgt.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@Data
|
||||
public class CancleSubsSttusReqDto implements Serializable {
|
||||
|
||||
public String subsId;
|
||||
|
||||
public String userId;
|
||||
|
||||
public String adminId;
|
||||
|
||||
public String prodCd; //요금제
|
||||
|
||||
}
|
||||
@@ -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 CancleSubsSttusResDto extends ResponseMessage implements Serializable{
|
||||
|
||||
// 데이터.
|
||||
private Object data;
|
||||
|
||||
public CancleSubsSttusResDto() {
|
||||
this.retCode = ApiResponseCode.SUCCESS.getResultCode();
|
||||
this.retMsg = ApiResponseCode.SUCCESS.getResultMsg();
|
||||
}
|
||||
|
||||
public CancleSubsSttusResDto(ApiResponseCode returnStr) {
|
||||
this.retCode = returnStr.getResultCode();
|
||||
this.retMsg = returnStr.getResultMsg();
|
||||
}
|
||||
|
||||
public CancleSubsSttusResDto(ApiResponseCode returnStr, Object data) {
|
||||
this.retCode = returnStr.getResultCode();
|
||||
this.retMsg = returnStr.getResultMsg();
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -31,8 +31,14 @@ public class SubsDetail implements Serializable {
|
||||
private String subsDt;
|
||||
@ApiModelProperty(example = "청약상태", name = "청약상태", dataType = "String")
|
||||
private String stat;
|
||||
@ApiModelProperty(example = "청약상태코드", name = "청약상태코드", dataType = "String")
|
||||
private String subsSttusCd;
|
||||
@ApiModelProperty(example = "청약ID", name = "청약ID", dataType = "String")
|
||||
private String subsId;
|
||||
@ApiModelProperty(example = "청약요금제명", name = "청약요금제명", dataType = "String")
|
||||
private String plan;
|
||||
@ApiModelProperty(example = "청약요금제코드", name = "청약요금제코드", dataType = "String")
|
||||
private String prodCd;
|
||||
@ApiModelProperty(example = "청약가입번호", name = "청약가입번호", dataType = "String")
|
||||
private String subsNo;
|
||||
@ApiModelProperty(example = "관리자ID", name = "관리자ID", dataType = "String")
|
||||
|
||||
@@ -389,6 +389,8 @@
|
||||
WHERE
|
||||
GRP_CD = 'SUBS_STTUS_CD'
|
||||
AND DTL_CD = esi.SUBS_STTUS_CD) AS STAT,
|
||||
esi.SUBS_STTUS_CD,
|
||||
esi.SUBS_ID,
|
||||
(
|
||||
SELECT
|
||||
PROD_NM
|
||||
@@ -397,6 +399,7 @@
|
||||
WHERE
|
||||
PROD_CD = esi.PROD_CD) AS PLAN,
|
||||
esi.ENTR_NO as SUBS_NO,
|
||||
esi.PROD_CD,
|
||||
esi.ATTRCTOR_ID AS CHANNEL_ID,
|
||||
esi.ATTRCTOR_NM AS CHANNEL_NM,
|
||||
esi.SUBSMNGR_ID AS ADMIN_ID,
|
||||
@@ -1683,4 +1686,75 @@
|
||||
NOW()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="cancleUserSttusCd" parameterType="kr.co.uplus.ez.api.custMgt.dto.CancleSubsSttus">
|
||||
/*CancleSubsSttus.cancleUserSttusCd - 임시개통, 가입 취소 시 사용자 상태 변경 ('99': 삭제) */
|
||||
UPDATE
|
||||
hubez_common.EZ_SVC_USER
|
||||
SET
|
||||
USER_STTUS_CD = '99'
|
||||
WHERE 1=1
|
||||
AND USER_ID = #{userId}
|
||||
|
||||
</update>
|
||||
|
||||
<update id="cancleSubsSttusCd" parameterType="kr.co.uplus.ez.api.custMgt.dto.CancleSubsSttusReqDto">
|
||||
/* CancleSubsSttus.cancleSubsSttusCd - 임시개통, 가입 취소 시 청약 상태 변경('98': 취소) */
|
||||
UPDATE
|
||||
hubez_common.EZ_SUBS_INFO
|
||||
SET
|
||||
SUBS_STTUS_CD = '98'
|
||||
WHERE 1=1
|
||||
AND SUBS_ID = #{subsId}
|
||||
</update>
|
||||
|
||||
<update id="updateCancleSbscstHst" parameterType="kr.co.uplus.ez.api.custMgt.dto.CancleSubsSttus">
|
||||
/* CancleSubsSttus.updateCancleSbscstHst - 임시개통, 가입 취소 시 청약 상태 히스토리 최신 날짜로 변경 */
|
||||
UPDATE
|
||||
hubez_common.EZ_SBSCST_HST
|
||||
SET
|
||||
EFCT_FNS_DT = NOW()
|
||||
WHERE
|
||||
SUBS_ID = #{subsId}
|
||||
AND EFCT_ST_DT =
|
||||
(
|
||||
SELECT
|
||||
EFCT_ST_DT
|
||||
FROM
|
||||
hubez_common.EZ_SBSCST_HST
|
||||
WHERE
|
||||
SUBS_ID = #{subsId}
|
||||
ORDER BY EFCT_ST_DT DESC
|
||||
LIMIT 1
|
||||
)
|
||||
</update>
|
||||
|
||||
<insert id="cancleSbscstHst" parameterType="kr.co.uplus.ez.api.custMgt.dto.CancleSubsSttusReqDto">
|
||||
/* CancleSubsSttus.cancleSbscstHst - 임시개통, 가입 취소 시 청약 상태 히스토리*/
|
||||
INSERT INTO
|
||||
hubez_common.EZ_SBSCST_HST
|
||||
(
|
||||
SUBS_ID,
|
||||
EFCT_ST_DT,
|
||||
EFCT_FNS_DT,
|
||||
PROD_CD,
|
||||
SUBS_STTUS_CD,
|
||||
REG_ID,
|
||||
REG_DT,
|
||||
CHG_ID,
|
||||
CHG_DT
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
#{subsId},
|
||||
NOW(),
|
||||
#{efctFnsDt},
|
||||
#{prodCd},
|
||||
'98',
|
||||
#{regId},
|
||||
NOW(),
|
||||
#{chgId},
|
||||
NOW()
|
||||
)
|
||||
</insert>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user