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:
@@ -16,7 +16,8 @@
|
||||
<p v-if="msg4 !== ''">{{ msg4 }}</p>
|
||||
</div>
|
||||
<div class="popup-btn1">
|
||||
<button class="btn-pcolor" @click="alertModalClose();">확인</button>
|
||||
<button class="btn-pcolor" v-if="title=='청약상태취소'" @click="alertModalClose2();">확인</button>
|
||||
<button class="btn-pcolor" v-else @click="alertModalClose();">확인</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -96,6 +97,7 @@ export default {
|
||||
msg2: '',
|
||||
msg3: '',
|
||||
msg4: '',
|
||||
serviceId: '',
|
||||
targetFocus: '',
|
||||
}
|
||||
},
|
||||
@@ -106,6 +108,7 @@ export default {
|
||||
this.msg2 = props.msg2;
|
||||
this.msg3 = props.msg3;
|
||||
this.msg4 = props.msg4;
|
||||
this.serviceId = props.serviceId;
|
||||
var dimmed = document.getElementsByClassName('alertModal');
|
||||
for (var i = 0; i < dimmed.length; i++) {
|
||||
dimmed[i].style.display = 'block';
|
||||
@@ -119,6 +122,13 @@ export default {
|
||||
}
|
||||
this.$parent.checkFocus();
|
||||
},
|
||||
alertModalClose2(){
|
||||
var dimmed = document.getElementsByClassName('alertModal');
|
||||
for (var i = 0; i < dimmed.length; i++) {
|
||||
dimmed[i].style.display = 'none';
|
||||
}
|
||||
this.$parent.subsDetail(this.serviceId);
|
||||
},
|
||||
alertModalCancel() {
|
||||
var dimmed = document.getElementsByClassName('alertModal');
|
||||
for (var i = 0; i < dimmed.length; i++) {
|
||||
|
||||
@@ -117,6 +117,10 @@ const userList = (params) => {
|
||||
return httpClient.post('/api/v1/bo/custMgt/userList', params);
|
||||
}
|
||||
|
||||
// 유저 ID 조회
|
||||
const cancleSubsSttus = (params) => {
|
||||
return httpClient.post('/api/v1/bo/custMgt/cancleSubsSttus', params);
|
||||
}
|
||||
|
||||
const getExcelHeader = category => {
|
||||
// 엑셀에 출력할 Header 정보를 Mockup 데이터로 관리한다.
|
||||
@@ -165,4 +169,5 @@ export default {
|
||||
chrgDetail,
|
||||
deleteChrg,
|
||||
userList,
|
||||
cancleSubsSttus,
|
||||
}
|
||||
|
||||
@@ -80,7 +80,10 @@
|
||||
<td colspan="5"><input type="text" disabled v-model="subsDt" /></td>
|
||||
<th>상태</th>
|
||||
<td colspan="5">
|
||||
<div class="input-double">
|
||||
<input type="text" disabled v-model="stat" />
|
||||
<button v-if="(this.subsSttusCd=='01')||(this.subsSttusCd=='00')" type="button" class="button grey btn-a" @click="cancleSubsStatus">청약취소</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="tr_input w75">
|
||||
@@ -214,6 +217,7 @@ export default {
|
||||
subsDt: '',
|
||||
stat: '',
|
||||
plan: '',
|
||||
prodCd: '',
|
||||
subsNo: '',
|
||||
adminId: '',
|
||||
adminNm: '',
|
||||
@@ -229,6 +233,8 @@ export default {
|
||||
saveConfirm: false,
|
||||
props: {},
|
||||
bindDcYn: '',
|
||||
subsSttusCd: '',
|
||||
subsId : '',
|
||||
};
|
||||
},
|
||||
props: {
|
||||
@@ -285,7 +291,6 @@ export default {
|
||||
this.row.endDt = '';
|
||||
this.row.page = 1;
|
||||
this.row.serviceId = this.$route.params.serviceId;
|
||||
console.log(this.row);
|
||||
this.$router.push({ name: 'subsList', params: this.row });
|
||||
},
|
||||
async subsDetail(serviceId) {
|
||||
@@ -306,8 +311,11 @@ export default {
|
||||
this.cprRegNo = result.data.cprRegNo;
|
||||
this.birth = result.data.birth;
|
||||
this.subsDt = result.data.subsDt;
|
||||
this.subsSttusCd = result.data.subsSttusCd;
|
||||
this.subsId = result.data.subsId;
|
||||
this.stat = result.data.stat;
|
||||
this.plan = result.data.plan;
|
||||
this.prodCd = result.data.prodCd;
|
||||
this.subsNo = result.data.subsNo;
|
||||
this.adminId = result.data.adminId;
|
||||
this.adminNm = result.data.adminNm;
|
||||
@@ -414,6 +422,33 @@ export default {
|
||||
return String.fromCharCode(s.match(/\d+/gm)[0]);
|
||||
});
|
||||
},
|
||||
|
||||
async cancleSubsStatus(){
|
||||
let param = {
|
||||
userId : this.serviceId,
|
||||
subsId : this.subsId,
|
||||
adminId : this.adminId,
|
||||
prodCd : this.prodCd,
|
||||
}
|
||||
try {
|
||||
const response = await custMgtApi.cancleSubsSttus(param);
|
||||
const result = response.data;
|
||||
if (result != null && result.retCode == '0000') {
|
||||
this.row.title = '청약상태취소';
|
||||
this.row.msg1 = '청약상태를 취소 하였습니다.';
|
||||
this.serviceId = this.serviceId;
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
} else {
|
||||
this.row.title = '청약상태취소';
|
||||
this.row.msg1 = '청약 상태 취소에 실패 하였습니다.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
}
|
||||
} catch (error) {
|
||||
this.row.title = '청약상태취소';
|
||||
this.row.msg1 = '청약 상태 취소에 실패 하였습니다.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -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