diff --git a/src/main/java/kr/co/uplus/ez/api/custMgt/CustMgtController.java b/src/main/java/kr/co/uplus/ez/api/custMgt/CustMgtController.java index 470fb46..3732eaf 100644 --- a/src/main/java/kr/co/uplus/ez/api/custMgt/CustMgtController.java +++ b/src/main/java/kr/co/uplus/ez/api/custMgt/CustMgtController.java @@ -57,6 +57,10 @@ import kr.co.uplus.ez.api.custMgt.dto.UpdateAdminInfoTotalReqDto; import kr.co.uplus.ez.api.custMgt.dto.UpdateAdminInfoTotalResDto; import kr.co.uplus.ez.api.custMgt.dto.UpdateUserReqDto; import kr.co.uplus.ez.api.custMgt.dto.UpdateUserResDto; +import kr.co.uplus.ez.api.custMgt.dto.UserLmtListExcelReqDto; +import kr.co.uplus.ez.api.custMgt.dto.UserLmtListExcelResDto; +import kr.co.uplus.ez.api.custMgt.dto.UserLmtListReqDto; +import kr.co.uplus.ez.api.custMgt.dto.UserLmtListResDto; import kr.co.uplus.ez.common.components.ValidComponents; import kr.co.uplus.ez.common.data.ApiResponseCode; import kr.co.uplus.ez.common.data.ApiResponseMessage; @@ -476,5 +480,49 @@ public class CustMgtController { } return custService.duplicateCheckUserId(insertUserReqDto); } + + /** + * date : 2023. 1. 1. + * auth : ckr + * desc : 요금제 구매 내역 목록 조회 + * @param UserLmtListReqDto + * @return UserLmtListRestDto + * @ + */ + @ApiOperation(value = "BLNCList", notes = "요금제 구매 내역 목록 조회") + @ApiResponses({ + @ApiResponse(code = HttpServletResponse.SC_OK, message = "SUCESS") + }) + @RequestMapping(value = "/BLNCList" , method = {RequestMethod.POST}) + @ResponseBody + public UserLmtListResDto BLNCList(@RequestBody @Valid UserLmtListReqDto userLmtListReqDto, BindingResult bindingResult) { + if(validComponents.validParameter(bindingResult)) { + return new UserLmtListResDto(ApiResponseCode.CM_PARAMETER_ERROR); + } + return custService.BLNCList(userLmtListReqDto); + } + + /** + * date : 2023. 1. 1. + * auth : ckr + * desc : 요금제 구매 내역 정보 목록 엑셀 다운로드 + * + * @param userLmtListExcelReqDto + * @return UserLmtListExcelResDto + * @ + */ + @ApiOperation(value = "BLNCListExcel", notes = "청약 고객 정보 목록 엑셀 다운로드") + @ApiResponses({ + @ApiResponse(code = HttpServletResponse.SC_OK, message = "SUCESS") + }) + @RequestMapping(value = "/BLNCListExcel" , method = {RequestMethod.POST}) + @ResponseBody + public UserLmtListExcelResDto BLNCListExcel(@RequestBody @Valid UserLmtListExcelReqDto userLmtListExcelReqDto, BindingResult bindingResult) { + if(validComponents.validParameter(bindingResult)) { + return new UserLmtListExcelResDto(ApiResponseCode.CM_PARAMETER_ERROR); + } + + return custService.userLmtListExcel(userLmtListExcelReqDto); + } } diff --git a/src/main/java/kr/co/uplus/ez/api/custMgt/CustMgtMapper.java b/src/main/java/kr/co/uplus/ez/api/custMgt/CustMgtMapper.java index c36af77..450659e 100644 --- a/src/main/java/kr/co/uplus/ez/api/custMgt/CustMgtMapper.java +++ b/src/main/java/kr/co/uplus/ez/api/custMgt/CustMgtMapper.java @@ -7,6 +7,8 @@ import org.apache.ibatis.annotations.Mapper; import java.util.List; import java.util.Map; +import javax.validation.Valid; + @Mapper public interface CustMgtMapper { @@ -106,4 +108,11 @@ public interface CustMgtMapper { /** 결합할인여부 수정*/ int updateBindDcYn(SubsDetail subDetail); + /** 청구정보 카운트 조회.*/ + int selectUserLmtListTotalCnt(UserLmtListReqDto userLmtListReqDto); + + /** 요금제 구매 내역 정보 목록 조회.*/ + List selectBLNCLists(UserLmtListReqDto userLmtListReqDto); + /** 요금제 구매 내역 정보 엑셀 목록 조회.*/ + List selectUserLmtListsExcel(UserLmtListExcelReqDto userLmtListExcelReqDto); } diff --git a/src/main/java/kr/co/uplus/ez/api/custMgt/CustMgtService.java b/src/main/java/kr/co/uplus/ez/api/custMgt/CustMgtService.java index 6a63570..3f13b11 100644 --- a/src/main/java/kr/co/uplus/ez/api/custMgt/CustMgtService.java +++ b/src/main/java/kr/co/uplus/ez/api/custMgt/CustMgtService.java @@ -25,6 +25,8 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.validation.Valid; + @Service public class CustMgtService { @@ -995,4 +997,74 @@ public class CustMgtService { return new InsertUserResDto(ApiResponseCode.SUCCESS); } + + /** + * date : 2023. 1. 1. + * auth : ckr + * desc : 요금제 구매 내역 목록 조회 + * @param UserLmtListReqDto + * @return UserLmtListRestDto + * @ + */ + public UserLmtListResDto BLNCList(UserLmtListReqDto userLmtListReqDto) { + CustMgtMapper custMgtMapper = sqlSessionMaster.getMapper(CustMgtMapper.class); + + String nowPage = String.valueOf(userLmtListReqDto.getPage()); + int totalCnt = custMgtMapper.selectUserLmtListTotalCnt(userLmtListReqDto); + if (totalCnt==0) { + UserLmtListRes userLmtListRes = new UserLmtListRes(); + userLmtListRes.setList(new ArrayList<>()); + + Paging paging = new Paging(); + paging.setPage(nowPage); + paging.setTotalCnt(String.valueOf(totalCnt)); + userLmtListRes.setPaging(paging); + + return new UserLmtListResDto(ApiResponseCode.CM_NOT_FOUND, userLmtListRes); + } + + int page = userLmtListReqDto.getPage(); + int pagePerRows = userLmtListReqDto.getPagePerRows(); + page = (page-1) * pagePerRows; + userLmtListReqDto.setPage(page); + + //리스트 조회 + List userlmtlist = custMgtMapper.selectBLNCLists(userLmtListReqDto); + + UserLmtListRes userLmtListRes = new UserLmtListRes(); + userLmtListRes.setList(userlmtlist); + + Paging paging = new Paging(); + paging.setPage(nowPage); + paging.setTotalCnt(String.valueOf(totalCnt)); + userLmtListRes.setPaging(paging); + + return new UserLmtListResDto(ApiResponseCode.SUCCESS, userLmtListRes); + } + + /** + * date : 2023. 1. 1. + * auth : ckr + * desc : 요금제 구매 내역 정보 목록 엑셀 다운로드 + * + * @param userLmtListExcelReqDto + * @return UserLmtListExcelResDto + */ + public UserLmtListExcelResDto userLmtListExcel(@Valid UserLmtListExcelReqDto userLmtListExcelReqDto) { + + CustMgtMapper custMgtMapper = sqlSessionMaster.getMapper(CustMgtMapper.class); + + UserLmtListRes userLmtListRes = new UserLmtListRes(); + //리스트 조회 + List userLmtLists = custMgtMapper.selectUserLmtListsExcel(userLmtListExcelReqDto); + + Paging paging = new Paging(); + paging.setTotalCnt(String.valueOf(userLmtLists.size())); + userLmtListRes.setPaging(paging); + userLmtListRes.setList(userLmtLists); + + return new UserLmtListExcelResDto(ApiResponseCode.SUCCESS,userLmtListRes); + } + + } diff --git a/src/main/java/kr/co/uplus/ez/api/custMgt/dto/UserLmtList.java b/src/main/java/kr/co/uplus/ez/api/custMgt/dto/UserLmtList.java new file mode 100644 index 0000000..2619afb --- /dev/null +++ b/src/main/java/kr/co/uplus/ez/api/custMgt/dto/UserLmtList.java @@ -0,0 +1,27 @@ +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 UserLmtList implements Serializable { + + @ApiModelProperty(example = "이용자일련번호", name = "이용자일련번호", dataType = "String") + private String userSeq; + @ApiModelProperty(example = "한도년월", name = "한도년월", dataType = "String") + private String lmtYm; + @ApiModelProperty(example = "요금제확보금액", name = "요금제확보금액", dataType = "String") + private String fxlmtamt; + @ApiModelProperty(example = "이월금액", name = "이월금액", dataType = "String") + private String cfwdAmt; + @ApiModelProperty(example = "총사용금액", name = "총사용금액", dataType = "String") + private String totalamt; + @ApiModelProperty(example = "당월사용금액", name = "당월사용금액", dataType = "String") + private String ymuseamt; + @ApiModelProperty(example = "잔액", name = "잔액", dataType = "String") + private String ymblnc; + +} diff --git a/src/main/java/kr/co/uplus/ez/api/custMgt/dto/UserLmtListExcelReqDto.java b/src/main/java/kr/co/uplus/ez/api/custMgt/dto/UserLmtListExcelReqDto.java new file mode 100644 index 0000000..48c3c5c --- /dev/null +++ b/src/main/java/kr/co/uplus/ez/api/custMgt/dto/UserLmtListExcelReqDto.java @@ -0,0 +1,28 @@ +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 UserLmtListExcelReqDto implements Serializable{ + + @ApiModelProperty(example = "조회 시작 날짜", name = "조회 시작 날짜", notes = "YYYYMMDD", dataType = "String") + private String startDt; + @ApiModelProperty(example = "조회 종료 날짜", name = "조회 종료 날짜", notes = "YYYYMMDD", dataType = "String") + private String endDt; + @ApiModelProperty(example = "청약 상태", name = "청약 상태", notes = "항목 : 전체(Default)/사용(01)/미납중지(02)/일시중지(03)/해지(04)", dataType = "String") + private String searchType1; + @ApiModelProperty(example = "유치채널", name = "유치채널", notes = "항목 : 전체(Default)/고객 셀프가입(01)/대리점(02)/고객센터(03)/직접영업(04)", dataType = "String") + private String searchType2; + @ApiModelProperty(example = "상세검색", name = "상세검색", notes = "항목 : 고객사명(01)/가입번호(02)/서비스ID(03)", dataType = "String") + private String searchType3; + @ApiModelProperty(example = "검색어 (입력항목)", name = "검색어 (입력항목)", dataType = "String") + private String searchText1; + @ApiModelProperty(example = "페이지당 조회할 목록 수", name = "페이지당 조회할 목록 수", dataType = "String") + private int pagePerRows; + @ApiModelProperty(example = "현재 페이지", name = "현재 페이지", dataType = "String") + private int page; +} diff --git a/src/main/java/kr/co/uplus/ez/api/custMgt/dto/UserLmtListExcelResDto.java b/src/main/java/kr/co/uplus/ez/api/custMgt/dto/UserLmtListExcelResDto.java new file mode 100644 index 0000000..330c954 --- /dev/null +++ b/src/main/java/kr/co/uplus/ez/api/custMgt/dto/UserLmtListExcelResDto.java @@ -0,0 +1,28 @@ +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; + +public class UserLmtListExcelResDto extends ResponseMessage implements Serializable{ + + private UserLmtListRes data; + + public UserLmtListExcelResDto() { + this.retCode = ApiResponseCode.SUCCESS.getResultCode(); + this.retMsg = ApiResponseCode.SUCCESS.getResultMsg(); + } + + public UserLmtListExcelResDto(ApiResponseCode returnStr) { + this.retCode = returnStr.getResultCode(); + this.retMsg = returnStr.getResultMsg(); + } + + public UserLmtListExcelResDto(ApiResponseCode returnStr, UserLmtListRes data) { + this.retCode = returnStr.getResultCode(); + this.retMsg = returnStr.getResultMsg(); + this.data = data; + } + +} diff --git a/src/main/java/kr/co/uplus/ez/api/custMgt/dto/UserLmtListReqDto.java b/src/main/java/kr/co/uplus/ez/api/custMgt/dto/UserLmtListReqDto.java new file mode 100644 index 0000000..6655979 --- /dev/null +++ b/src/main/java/kr/co/uplus/ez/api/custMgt/dto/UserLmtListReqDto.java @@ -0,0 +1,29 @@ +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 UserLmtListReqDto implements Serializable{ + + @ApiModelProperty(example = "조회 시작 날짜", name = "조회 시작 날짜", notes = "YYYYMMDD", dataType = "String") + private String startDt; + @ApiModelProperty(example = "조회 종료 날짜", name = "조회 종료 날짜", notes = "YYYYMMDD", dataType = "String") + private String endDt; + @ApiModelProperty(example = "청약 상태", name = "청약 상태", notes = "항목 : 전체(Default)/사용(01)/미납중지(02)/일시중지(03)/해지(04)", dataType = "String") + private String searchType1; + @ApiModelProperty(example = "유치채널", name = "유치채널", notes = "항목 : 전체(Default)/고객 셀프가입(01)/대리점(02)/고객센터(03)/직접영업(04)", dataType = "String") + private String searchType2; + @ApiModelProperty(example = "상세검색", name = "상세검색", notes = "항목 : 고객사명(01)/가입번호(02)/서비스ID(03)", dataType = "String") + private String searchType3; + @ApiModelProperty(example = "검색어 (입력항목)", name = "검색어 (입력항목)", dataType = "String") + private String searchText1; + @ApiModelProperty(example = "페이지당 조회할 목록 수", name = "페이지당 조회할 목록 수", dataType = "String") + private int pagePerRows; + @ApiModelProperty(example = "현재 페이지", name = "현재 페이지", dataType = "String") + private int page; + +} diff --git a/src/main/java/kr/co/uplus/ez/api/custMgt/dto/UserLmtListRes.java b/src/main/java/kr/co/uplus/ez/api/custMgt/dto/UserLmtListRes.java new file mode 100644 index 0000000..dc4a819 --- /dev/null +++ b/src/main/java/kr/co/uplus/ez/api/custMgt/dto/UserLmtListRes.java @@ -0,0 +1,15 @@ +package kr.co.uplus.ez.api.custMgt.dto; + +import java.io.Serializable; +import java.util.List; + +import kr.co.uplus.ez.common.data.Paging; +import lombok.Data; + +@SuppressWarnings("serial") +@Data +public class UserLmtListRes implements Serializable{ + + private List list; + private Paging paging; +} diff --git a/src/main/java/kr/co/uplus/ez/api/custMgt/dto/UserLmtListResDto.java b/src/main/java/kr/co/uplus/ez/api/custMgt/dto/UserLmtListResDto.java new file mode 100644 index 0000000..d61542b --- /dev/null +++ b/src/main/java/kr/co/uplus/ez/api/custMgt/dto/UserLmtListResDto.java @@ -0,0 +1,30 @@ +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 UserLmtListResDto extends ResponseMessage implements Serializable{ + + private UserLmtListRes data; + + public UserLmtListResDto() { + this.retCode = ApiResponseCode.SUCCESS.getResultCode(); + this.retMsg = ApiResponseCode.SUCCESS.getResultMsg(); + } + + public UserLmtListResDto(ApiResponseCode returnStr) { + this.retCode = returnStr.getResultCode(); + this.retMsg = returnStr.getResultMsg(); + } + + public UserLmtListResDto(ApiResponseCode returnStr, UserLmtListRes data) { + this.retCode = returnStr.getResultCode(); + this.retMsg = returnStr.getResultMsg(); + this.data = data; + } + +} diff --git a/src/main/resources/mapper/mysql/custMgt/custMgt-mapper.xml b/src/main/resources/mapper/mysql/custMgt/custMgt-mapper.xml index 5c88977..91c608b 100644 --- a/src/main/resources/mapper/mysql/custMgt/custMgt-mapper.xml +++ b/src/main/resources/mapper/mysql/custMgt/custMgt-mapper.xml @@ -1143,4 +1143,83 @@ WHERE ENTR_NO = #{entrNo} + +