admin_chrg 유저ID 조회 수정

This commit is contained in:
2023-03-29 10:49:34 +09:00
parent 393f802915
commit c3421a81ab
12 changed files with 197 additions and 20 deletions

View File

@@ -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

View File

@@ -117,8 +117,13 @@ public interface CustMgtMapper {
List<ChrgList> selectChrgList(ChrgListReqDto chrgListReqDto);
/** 충전관리 상세 조회 */
ChrgDetail selectChrgDetail(ChrgDetailReqDto chrgDetailReqDto);
/**유저ID 카운트 조회*/
int selectuserTotalCnt(UserListReqDto userListReqDto);
/**유저ID 목록 조회*/
List<UserinInfo> selectUserList(UserListReqDto userListReqDto);
/**이용자 충전번호 */
String getChrgSeq();
/**충전관리 등록 */
void insertChrgInfo(ChrgInfo chrgInfo);
/**충전관리 수정 */
@@ -127,6 +132,7 @@ public interface CustMgtMapper {
void addChrg(ChrgInfo chrgInfo);
/**충전관리 삭제 */
void deleteChrg(DeleteChrgReqDto deleteChrgReqDto);

View File

@@ -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> 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> 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 부분

View File

@@ -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;
}

View File

@@ -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<UserinInfo> list;
}

View File

@@ -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;
}
}

View File

@@ -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;
}

View File

@@ -1200,12 +1200,10 @@
WHERE 1 = 1
AND ecm.USE_YN ='Y'
AND esi.SUBS_STTUS_CD ='02'
<if test="startDt != null and startDt != ''">
AND (ecm.STRT_YM <![CDATA[ >= ]]> STR_TO_DATE(concat(REPLACE(#{startDt}, '-', '' ),'000000') , '%Y%m')
</if>
<if test="endDt != null and endDt != ''">
OR ecm.END_YM <![CDATA[ <= ]]> STR_TO_DATE(concat(REPLACE(#{endDt}, '-', '' ),'235959'), '%Y%m'))
</if>
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})
<if test="searchType1 != null and searchType1 != ''">
<if test="searchType1 == '01' and searchText1 != null and searchText1 != ''">
AND UPPER(eci.CUST_NM) LIKE UPPER(CONCAT('%', #{searchText1}, '%'))
@@ -1242,6 +1240,42 @@
ORDER BY ecm.CHRG_SEQ DESC
</select>
<!-- 유저ID 카운트 조회 -->
<select id="selectuserTotalCnt" parameterType="kr.co.uplus.ez.api.custMgt.dto.UserListReqDto" resultType="int">
/* custMgt-mapper.xml(getChrgSeq) */
SELECT
COUNT(*)
FROM hubez_common.EZ_SVC_USER esu
INNER JOIN hubez_common.EZ_SUBS_INFO esi ON esi.USER_SEQ = esu.USER_SEQ
INNER JOIN hubez_common.EZ_CUST_INFO eci ON eci.CUST_SEQ = esu.CUST_SEQ
WHERE 1 = 1
AND esu.USER_TP_CD ='01'
AND esi.SUBS_STTUS_CD ='02'
AND esu.USER_ID LIKE CONCAT('%' , #{searchText1}, '%')
</select>
<!-- 유저ID 목록 조회 -->
<select id="selectUserList" parameterType="kr.co.uplus.ez.api.custMgt.dto.UserListReqDto" resultType="kr.co.uplus.ez.api.custMgt.dto.UserinInfo">
/* custMgt-mapper.xml(getChrgSeq) */
SELECT
esu.USER_ID
, eci.CUST_NM
, esu.USER_SEQ
, esu.USER_STTUS_CD
, esu.USER_TP_CD
FROM hubez_common.EZ_SVC_USER esu
INNER JOIN hubez_common.EZ_SUBS_INFO esi ON esi.USER_SEQ = esu.USER_SEQ
INNER JOIN hubez_common.EZ_CUST_INFO eci ON eci.CUST_SEQ = esu.CUST_SEQ
WHERE 1 = 1
AND esu.USER_TP_CD ='01'
AND esi.SUBS_STTUS_CD ='02'
AND esu.USER_ID LIKE CONCAT('%' , #{searchText1}, '%')
</select>
<!-- 이용자 충전번호 조회(채번) -->
<select id="getChrgSeq" resultType="String">
/* custMgt-mapper.xml(getChrgSeq) */