From c3421a81ab0c0783c8ecc4480fbc5c910ea84aa4 Mon Sep 17 00:00:00 2001 From: won503 Date: Wed, 29 Mar 2023 10:49:34 +0900 Subject: [PATCH] =?UTF-8?q?admin=5Fchrg=20=EC=9C=A0=EC=A0=80ID=20=EC=A1=B0?= =?UTF-8?q?=ED=9A=8C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../custMgt/components/InsertChrgModal.vue | 6 +-- .../custMgt/components/UserListPop.vue | 9 ++-- .../src/modules/custMgt/service/custMgtApi.js | 7 +++ .../src/modules/custMgt/views/ChrgList.vue | 10 ++-- .../ez/api/custMgt/CustMgtController.java | 21 +++++++++ .../uplus/ez/api/custMgt/CustMgtMapper.java | 6 +++ .../uplus/ez/api/custMgt/CustMgtService.java | 33 ++++++++++++- .../ez/api/custMgt/dto/UserListReqDto.java | 14 ++++++ .../uplus/ez/api/custMgt/dto/UserListRes.java | 11 +++++ .../ez/api/custMgt/dto/UserListResDto.java | 31 +++++++++++++ .../uplus/ez/api/custMgt/dto/UserinInfo.java | 23 ++++++++++ .../mapper/mysql/custMgt/custMgt-mapper.xml | 46 ++++++++++++++++--- 12 files changed, 197 insertions(+), 20 deletions(-) create mode 100644 src/main/java/kr/co/uplus/ez/api/custMgt/dto/UserListReqDto.java create mode 100644 src/main/java/kr/co/uplus/ez/api/custMgt/dto/UserListRes.java create mode 100644 src/main/java/kr/co/uplus/ez/api/custMgt/dto/UserListResDto.java create mode 100644 src/main/java/kr/co/uplus/ez/api/custMgt/dto/UserinInfo.java diff --git a/frontend/src/modules/custMgt/components/InsertChrgModal.vue b/frontend/src/modules/custMgt/components/InsertChrgModal.vue index 57d4540..c0c0b2d 100644 --- a/frontend/src/modules/custMgt/components/InsertChrgModal.vue +++ b/frontend/src/modules/custMgt/components/InsertChrgModal.vue @@ -12,9 +12,9 @@ 유저 ID diff --git a/frontend/src/modules/custMgt/components/UserListPop.vue b/frontend/src/modules/custMgt/components/UserListPop.vue index 5134925..f3354d7 100644 --- a/frontend/src/modules/custMgt/components/UserListPop.vue +++ b/frontend/src/modules/custMgt/components/UserListPop.vue @@ -16,13 +16,13 @@ ID - 사업자등록번호 + 고객사명 {{ item.userId }} - {{ item.bregNo }} + {{ item.custNm }} @@ -53,8 +53,7 @@ export default { }, methods : { - search (isKeep) { - }, + setUserInfo (props){ this.$emit('event-data', props) this.UserListPopClose(); @@ -81,7 +80,7 @@ export default { if(this.row.searchText1 == ''){ return false; } - const response = await custMgtApi.memberDetail(this.row); + const response = await custMgtApi.userList(this.row); const result = response.data; if (result != null && result.retCode == "0000") { this.list = result.data.list diff --git a/frontend/src/modules/custMgt/service/custMgtApi.js b/frontend/src/modules/custMgt/service/custMgtApi.js index 2286ef3..852b827 100644 --- a/frontend/src/modules/custMgt/service/custMgtApi.js +++ b/frontend/src/modules/custMgt/service/custMgtApi.js @@ -108,6 +108,12 @@ const deleteChrg = (params) => { return httpClient.post('/api/v1/bo/custMgt/deleteChrg', params); } +// 유저 ID 조회 +const userList = (params) => { + return httpClient.post('/api/v1/bo/custMgt/userList', params); +} + + const getExcelHeader = category => { // 엑셀에 출력할 Header 정보를 Mockup 데이터로 관리한다. return new Promise(function(resolve, reject) { @@ -153,4 +159,5 @@ export default { updateChrg, chrgDetail, deleteChrg, + userList, } diff --git a/frontend/src/modules/custMgt/views/ChrgList.vue b/frontend/src/modules/custMgt/views/ChrgList.vue index 632b7c1..41512ff 100644 --- a/frontend/src/modules/custMgt/views/ChrgList.vue +++ b/frontend/src/modules/custMgt/views/ChrgList.vue @@ -302,8 +302,8 @@ export default { if (type != undefined && type != null) { let initStartDate = new Date(); let initEndDate = new Date(); - initStartDate.setMonth(Number(moment(initStartDate).format('MM')) - 4) - initEndDate.setMonth(Number(moment(initEndDate).format('MM')) - 2) + initStartDate.setMonth(Number(moment(initStartDate).format('MM')) -100) + initEndDate.setMonth(Number(moment(initEndDate).format('MM')) + 100) if (type == 'start') { @@ -327,7 +327,7 @@ export default { } else if (this.sDateDiv == 'year') { return moment(date).format('YYYY'); } else { - return moment(date).format('YYYY-MM-DD'); + return moment(date).format('YYYY-MM'); } }, gridParamSet() { @@ -338,12 +338,12 @@ export default { }, initSetStartDate() { let initStartDate = new Date(); - initStartDate.setMonth(Number(moment(initStartDate).format('MM')) - 4); + initStartDate.setMonth(Number(moment(initStartDate).format('MM')) ); this.startDate = initStartDate; }, initSetEndDate() { let initEndDate = new Date(); - initEndDate.setMonth(Number(moment(initEndDate).format('MM')) - 2); + initEndDate.setMonth(Number(moment(initEndDate).format('MM')) +1); this.endDate = initEndDate; }, 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 8350e5b..e97c18e 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 @@ -67,6 +67,8 @@ import kr.co.uplus.ez.api.custMgt.dto.UpdateChrgReqDto; import kr.co.uplus.ez.api.custMgt.dto.UpdateChrgResDto; 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.UserListReqDto; +import kr.co.uplus.ez.api.custMgt.dto.UserListResDto; 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; @@ -534,6 +536,25 @@ public class CustMgtController { return custService.chrgDetail(chrgDetailReqDto); } + /** + * date : 2022. 4. 25. + * auth : ckr + * desc : 유저ID 목록 조회 + * @param adminListReqDto + */ + @ApiOperation(value = "/userList", notes = "관리자ID 목록 조회") + @ApiResponses({ @ApiResponse(code = HttpServletResponse.SC_OK, message = "SUCESS") }) + @RequestMapping(value = "userList", method = { RequestMethod.POST }) + @ResponseBody + public UserListResDto userList(@RequestBody @Valid UserListReqDto userListReqDto, BindingResult bindingResult) { + + if (validComponents.validParameter(bindingResult)) { + return new UserListResDto(ApiResponseCode.CM_PARAMETER_ERROR); + } + + return custService.userList(userListReqDto); + } + /** * date : 2023. 3. 15. * auth : won 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 daeade1..76268e6 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 @@ -117,8 +117,13 @@ public interface CustMgtMapper { List selectChrgList(ChrgListReqDto chrgListReqDto); /** 충전관리 상세 조회 */ ChrgDetail selectChrgDetail(ChrgDetailReqDto chrgDetailReqDto); + /**유저ID 카운트 조회*/ + int selectuserTotalCnt(UserListReqDto userListReqDto); + /**유저ID 목록 조회*/ + List selectUserList(UserListReqDto userListReqDto); /**이용자 충전번호 */ String getChrgSeq(); + /**충전관리 등록 */ void insertChrgInfo(ChrgInfo chrgInfo); /**충전관리 수정 */ @@ -127,6 +132,7 @@ public interface CustMgtMapper { void addChrg(ChrgInfo chrgInfo); /**충전관리 삭제 */ void deleteChrg(DeleteChrgReqDto deleteChrgReqDto); + 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 7e9663c..38892ea 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 @@ -22,7 +22,6 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; -import java.util.Iterator; import java.util.List; import java.util.Map; @@ -1030,6 +1029,10 @@ public class CustMgtService { int pagePerRows = chrgListReqDto.getPagePerRows(); page = (page - 1) * pagePerRows; chrgListReqDto.setPage(page); + +// Date now = new Date(); +// String chrgYm = DateUtils.dateToStr(now, "yyyyMM"); + List chrgList= custMgtMapper.selectChrgList(chrgListReqDto); @@ -1187,6 +1190,34 @@ public class CustMgtService { return new DeleteChrgResDto(ApiResponseCode.SUCCESS); } + /** + * date : 2022. 4. 25. + * auth : ckr + * desc : 유저ID 목록 조회 + * @param userListReqDto + * @return + */ + public UserListResDto userList(UserListReqDto userListReqDto) { + CustMgtMapper custMgtMapper = sqlSessionMaster.getMapper(CustMgtMapper.class); + int totalCnt = custMgtMapper.selectuserTotalCnt(userListReqDto); + + if(totalCnt == 0) { + UserListRes userListRes = new UserListRes(); + userListRes.setList(new ArrayList<>()); + return new UserListResDto(ApiResponseCode.CM_NOT_FOUND, userListRes); + } + + List userinInfo = custMgtMapper.selectUserList(userListReqDto); + + Paging paging = new Paging(); + paging.setTotalCnt(String.valueOf(totalCnt)); + + UserListRes userListRes = new UserListRes(); + userListRes.setList(userinInfo); + + return new UserListResDto(ApiResponseCode.SUCCESS, userListRes); + } + /* 2023-03-07 add request 부분 diff --git a/src/main/java/kr/co/uplus/ez/api/custMgt/dto/UserListReqDto.java b/src/main/java/kr/co/uplus/ez/api/custMgt/dto/UserListReqDto.java new file mode 100644 index 0000000..2394e98 --- /dev/null +++ b/src/main/java/kr/co/uplus/ez/api/custMgt/dto/UserListReqDto.java @@ -0,0 +1,14 @@ +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 UserListReqDto implements Serializable{ + + @ApiModelProperty(example = "검색어", name = "검색어", dataType = "String") + private String searchText1; +} diff --git a/src/main/java/kr/co/uplus/ez/api/custMgt/dto/UserListRes.java b/src/main/java/kr/co/uplus/ez/api/custMgt/dto/UserListRes.java new file mode 100644 index 0000000..38df65d --- /dev/null +++ b/src/main/java/kr/co/uplus/ez/api/custMgt/dto/UserListRes.java @@ -0,0 +1,11 @@ +package kr.co.uplus.ez.api.custMgt.dto; + +import java.util.List; + +import lombok.Data; +@SuppressWarnings("serial") +@Data +public class UserListRes { + + List list; +} diff --git a/src/main/java/kr/co/uplus/ez/api/custMgt/dto/UserListResDto.java b/src/main/java/kr/co/uplus/ez/api/custMgt/dto/UserListResDto.java new file mode 100644 index 0000000..02a017c --- /dev/null +++ b/src/main/java/kr/co/uplus/ez/api/custMgt/dto/UserListResDto.java @@ -0,0 +1,31 @@ +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 UserListResDto extends ResponseMessage implements Serializable{ + + // 데이터. + private UserListRes data; + + public UserListResDto() { + this.retCode = ApiResponseCode.SUCCESS.getResultCode(); + this.retMsg = ApiResponseCode.SUCCESS.getResultMsg(); + } + + public UserListResDto(ApiResponseCode returnStr) { + this.retCode = returnStr.getResultCode(); + this.retMsg = returnStr.getResultMsg(); + } + + public UserListResDto(ApiResponseCode returnStr, UserListRes 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/UserinInfo.java b/src/main/java/kr/co/uplus/ez/api/custMgt/dto/UserinInfo.java new file mode 100644 index 0000000..7e587c9 --- /dev/null +++ b/src/main/java/kr/co/uplus/ez/api/custMgt/dto/UserinInfo.java @@ -0,0 +1,23 @@ +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 UserinInfo implements Serializable{ + + @ApiModelProperty(example = "고객명", name = "고객명", dataType = "String") + private String userId; + @ApiModelProperty(example = "고객사명", name = "고객사명", dataType = "String") + private String custNm; + @ApiModelProperty(example = "유저seq", name = "유저seq", dataType = "String") + private String userSeq; + @ApiModelProperty(example = "이용자 상태 코드", name = "이용자 상태 코드", dataType = "String") + private String userSttusCd; + @ApiModelProperty(example = "이용자 유형 코드", name = "이용자 유형 코드", dataType = "String") + private String userTpCd; + +} diff --git a/src/main/resources/mapper/mysql/custMgt/custMgt-mapper.xml b/src/main/resources/mapper/mysql/custMgt/custMgt-mapper.xml index b971517..19d787f 100644 --- a/src/main/resources/mapper/mysql/custMgt/custMgt-mapper.xml +++ b/src/main/resources/mapper/mysql/custMgt/custMgt-mapper.xml @@ -1200,12 +1200,10 @@ WHERE 1 = 1 AND ecm.USE_YN ='Y' AND esi.SUBS_STTUS_CD ='02' - - AND (ecm.STRT_YM = ]]> STR_TO_DATE(concat(REPLACE(#{startDt}, '-', '' ),'000000') , '%Y%m') - - - OR ecm.END_YM STR_TO_DATE(concat(REPLACE(#{endDt}, '-', '' ),'235959'), '%Y%m')) - + AND (#{startDt} BETWEEN ecm.STRT_YM AND ecm.END_YM + OR #{endDt} BETWEEN ecm.STRT_YM AND ecm.END_YM + OR ecm.STRT_YM BETWEEN #{startDt} AND #{endDt} + OR ecm.END_YM BETWEEN #{startDt} AND #{endDt}) AND UPPER(eci.CUST_NM) LIKE UPPER(CONCAT('%', #{searchText1}, '%')) @@ -1242,6 +1240,42 @@ ORDER BY ecm.CHRG_SEQ DESC + + + + + + + + +